fidl_test_structuredconfig_receiver_shim/
fidl_test_structuredconfig_receiver_shim.rs#![warn(clippy::all)]
#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
use bitflags::bitflags;
use fidl::client::QueryResponseFut;
use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
use fidl::endpoints::{ControlHandle as _, Responder as _};
use futures::future::{self, MaybeDone, TryFutureExt};
use zx_status;
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct ConfigServiceMarker;
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceMarker for ConfigServiceMarker {
type Proxy = ConfigServiceProxy;
type Request = ConfigServiceRequest;
const SERVICE_NAME: &'static str = "test.structuredconfig.receiver.shim.ConfigService";
}
#[cfg(target_os = "fuchsia")]
pub enum ConfigServiceRequest {
Puppet(fidl_test_structuredconfig_receiver::ConfigReceiverPuppetRequestStream),
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceRequest for ConfigServiceRequest {
type Service = ConfigServiceMarker;
fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
match name {
"puppet" => Self::Puppet(
<fidl_test_structuredconfig_receiver::ConfigReceiverPuppetRequestStream as fidl::endpoints::RequestStream>::from_channel(_channel),
),
_ => panic!("no such member protocol name for service ConfigService"),
}
}
fn member_names() -> &'static [&'static str] {
&["puppet"]
}
}
#[cfg(target_os = "fuchsia")]
pub struct ConfigServiceProxy(#[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>);
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceProxy for ConfigServiceProxy {
type Service = ConfigServiceMarker;
fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
Self(opener)
}
}
#[cfg(target_os = "fuchsia")]
impl ConfigServiceProxy {
pub fn connect_to_puppet(
&self,
) -> Result<fidl_test_structuredconfig_receiver::ConfigReceiverPuppetProxy, fidl::Error> {
let (proxy, server_end) = fidl::endpoints::create_proxy::<
fidl_test_structuredconfig_receiver::ConfigReceiverPuppetMarker,
>();
self.connect_channel_to_puppet(server_end)?;
Ok(proxy)
}
pub fn connect_to_puppet_sync(
&self,
) -> Result<
fidl_test_structuredconfig_receiver::ConfigReceiverPuppetSynchronousProxy,
fidl::Error,
> {
let (proxy, server_end) = fidl::endpoints::create_sync_proxy::<
fidl_test_structuredconfig_receiver::ConfigReceiverPuppetMarker,
>();
self.connect_channel_to_puppet(server_end)?;
Ok(proxy)
}
pub fn connect_channel_to_puppet(
&self,
server_end: fidl::endpoints::ServerEnd<
fidl_test_structuredconfig_receiver::ConfigReceiverPuppetMarker,
>,
) -> Result<(), fidl::Error> {
self.0.open_member("puppet", server_end.into_channel())
}
}
mod internal {
use super::*;
}