blob: 2e1b26fbafc40ec81f6b606cc7a5d484a13feb05 [file] [log] [blame]
// WARNING: This file is machine generated by fidlgen.
#![allow(
unused_parens, // one-element-tuple-case is not a tuple
unused_mut, // not all args require mutation, but many do
nonstandard_style, // auto-caps does its best, but is not always successful
)]
#![recursion_limit = "512"]
#[cfg(target_os = "fuchsia")]
#[allow(unused_imports)]
use fuchsia_zircon as zx;
#[allow(unused_imports)]
use {
bitflags::bitflags,
fidl::{
client::{decode_transaction_body_fut, QueryResponseFut},
encoding::{Decodable as _, Encodable as _},
endpoints::{ControlHandle as _, Responder as _},
fidl_bits, fidl_empty_struct, fidl_enum, fidl_struct, fidl_struct_copy, fidl_table,
fidl_union, wrap_handle_metadata,
},
fuchsia_zircon_status as zx_status,
futures::future::{self, MaybeDone, TryFutureExt},
};
const _FIDL_TRACE_BINDINGS_RUST: u32 = 6;
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct FirstProtocolMarker;
impl fidl::endpoints::ProtocolMarker for FirstProtocolMarker {
type Proxy = FirstProtocolProxy;
type RequestStream = FirstProtocolRequestStream;
const DEBUG_NAME: &'static str = "(anonymous) FirstProtocol";
}
pub trait FirstProtocolProxyInterface: Send + Sync {
fn r#method_on_first(&self) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct FirstProtocolSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl FirstProtocolSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <FirstProtocolMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
/// Waits until an event arrives and returns it. It is safe for other
/// threads to make concurrent requests while waiting for an event.
pub fn wait_for_event(&self, deadline: zx::Time) -> Result<FirstProtocolEvent, fidl::Error> {
FirstProtocolEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#method_on_first(&self) -> Result<(), fidl::Error> {
self.client.send(&mut (), 0x5828c91b57492931, fidl::encoding::DynamicFlags::empty())
}
}
#[derive(Debug, Clone)]
pub struct FirstProtocolProxy {
client: fidl::client::Client,
}
impl fidl::endpoints::Proxy for FirstProtocolProxy {
type Protocol = FirstProtocolMarker;
fn from_channel(inner: fidl::AsyncChannel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
self.client.into_channel().map_err(|client| Self { client })
}
fn as_channel(&self) -> &::fidl::AsyncChannel {
self.client.as_channel()
}
}
impl FirstProtocolProxy {
/// Create a new Proxy for FirstProtocol
pub fn new(channel: fidl::AsyncChannel) -> Self {
let protocol_name = <FirstProtocolMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
/// Get a Stream of events from the remote end of the FirstProtocol protocol
///
/// # Panics
///
/// Panics if the event stream was already taken.
pub fn take_event_stream(&self) -> FirstProtocolEventStream {
FirstProtocolEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#method_on_first(&self) -> Result<(), fidl::Error> {
FirstProtocolProxyInterface::r#method_on_first(self)
}
}
impl FirstProtocolProxyInterface for FirstProtocolProxy {
fn r#method_on_first(&self) -> Result<(), fidl::Error> {
self.client.send(&mut (), 0x5828c91b57492931, fidl::encoding::DynamicFlags::empty())
}
}
pub struct FirstProtocolEventStream {
event_receiver: fidl::client::EventReceiver,
}
impl std::marker::Unpin for FirstProtocolEventStream {}
impl futures::stream::FusedStream for FirstProtocolEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for FirstProtocolEventStream {
type Item = Result<FirstProtocolEvent, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
let buf = match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
&mut self.event_receiver,
cx
)?) {
Some(buf) => buf,
None => return std::task::Poll::Ready(None),
};
std::task::Poll::Ready(Some(FirstProtocolEvent::decode(buf)))
}
}
#[derive(Debug)]
pub enum FirstProtocolEvent {}
impl FirstProtocolEvent {
fn decode(mut buf: fidl::MessageBufEtc) -> Result<FirstProtocolEvent, fidl::Error> {
let (bytes, _handles) = buf.split_mut();
let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
match tx_header.ordinal() {
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal(),
protocol_name: <FirstProtocolMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
/// A Stream of incoming requests for FirstProtocol
pub struct FirstProtocolRequestStream {
inner: std::sync::Arc<fidl::ServeInner>,
is_terminated: bool,
}
impl std::marker::Unpin for FirstProtocolRequestStream {}
impl futures::stream::FusedStream for FirstProtocolRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for FirstProtocolRequestStream {
type Protocol = FirstProtocolMarker;
type ControlHandle = FirstProtocolControlHandle;
fn from_channel(channel: fidl::AsyncChannel) -> Self {
Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
}
fn control_handle(&self) -> Self::ControlHandle {
FirstProtocolControlHandle { inner: self.inner.clone() }
}
fn into_inner(self) -> (::std::sync::Arc<fidl::ServeInner>, bool) {
(self.inner, self.is_terminated)
}
fn from_inner(inner: std::sync::Arc<fidl::ServeInner>, is_terminated: bool) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for FirstProtocolRequestStream {
type Item = Result<FirstProtocolRequest, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
let this = &mut *self;
if this.inner.poll_shutdown(cx) {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
if this.is_terminated {
panic!("polled FirstProtocolRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf(|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(e))))
}
}
// A message has been received from the channel
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
if !header.is_compatible() {
return std::task::Poll::Ready(Some(Err(fidl::Error::IncompatibleMagicNumber(
header.magic_number(),
))));
}
std::task::Poll::Ready(Some(match header.ordinal() {
0x5828c91b57492931 => {
let mut req: () = fidl::encoding::Decodable::new_empty();
fidl::duration_begin!("fidl", "decode", "bindings" => _FIDL_TRACE_BINDINGS_RUST, "name" => "test.service/FirstProtocolMethodOnFirstRequest");
fidl::trace_blob!("fidl:blob", "decode", bytes);
fidl::encoding::Decoder::decode_into(&header, _body_bytes, handles, &mut req)?;
fidl::duration_end!("fidl", "decode", "bindings" => _FIDL_TRACE_BINDINGS_RUST, "size" => bytes.len() as u32, "handle_count" => handles.len() as u32);
let control_handle = FirstProtocolControlHandle { inner: this.inner.clone() };
Ok(FirstProtocolRequest::MethodOnFirst { control_handle })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal(),
protocol_name:
<FirstProtocolMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
})
}
}
#[derive(Debug)]
pub enum FirstProtocolRequest {
MethodOnFirst { control_handle: FirstProtocolControlHandle },
}
impl FirstProtocolRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_method_on_first(self) -> Option<(FirstProtocolControlHandle)> {
if let FirstProtocolRequest::MethodOnFirst { control_handle } = self {
Some((control_handle))
} else {
None
}
}
/// Name of the method defined in FIDL
pub fn method_name(&self) -> &'static str {
match *self {
FirstProtocolRequest::MethodOnFirst { .. } => "method_on_first",
}
}
}
#[derive(Debug, Clone)]
pub struct FirstProtocolControlHandle {
inner: std::sync::Arc<fidl::ServeInner>,
}
impl fidl::endpoints::ControlHandle for FirstProtocolControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
}
impl FirstProtocolControlHandle {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct SecondProtocolMarker;
impl fidl::endpoints::ProtocolMarker for SecondProtocolMarker {
type Proxy = SecondProtocolProxy;
type RequestStream = SecondProtocolRequestStream;
const DEBUG_NAME: &'static str = "(anonymous) SecondProtocol";
}
pub trait SecondProtocolProxyInterface: Send + Sync {
fn r#method_on_second(&self) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct SecondProtocolSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl SecondProtocolSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <SecondProtocolMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
/// Waits until an event arrives and returns it. It is safe for other
/// threads to make concurrent requests while waiting for an event.
pub fn wait_for_event(&self, deadline: zx::Time) -> Result<SecondProtocolEvent, fidl::Error> {
SecondProtocolEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#method_on_second(&self) -> Result<(), fidl::Error> {
self.client.send(&mut (), 0x70b439758de25c44, fidl::encoding::DynamicFlags::empty())
}
}
#[derive(Debug, Clone)]
pub struct SecondProtocolProxy {
client: fidl::client::Client,
}
impl fidl::endpoints::Proxy for SecondProtocolProxy {
type Protocol = SecondProtocolMarker;
fn from_channel(inner: fidl::AsyncChannel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
self.client.into_channel().map_err(|client| Self { client })
}
fn as_channel(&self) -> &::fidl::AsyncChannel {
self.client.as_channel()
}
}
impl SecondProtocolProxy {
/// Create a new Proxy for SecondProtocol
pub fn new(channel: fidl::AsyncChannel) -> Self {
let protocol_name = <SecondProtocolMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
/// Get a Stream of events from the remote end of the SecondProtocol protocol
///
/// # Panics
///
/// Panics if the event stream was already taken.
pub fn take_event_stream(&self) -> SecondProtocolEventStream {
SecondProtocolEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#method_on_second(&self) -> Result<(), fidl::Error> {
SecondProtocolProxyInterface::r#method_on_second(self)
}
}
impl SecondProtocolProxyInterface for SecondProtocolProxy {
fn r#method_on_second(&self) -> Result<(), fidl::Error> {
self.client.send(&mut (), 0x70b439758de25c44, fidl::encoding::DynamicFlags::empty())
}
}
pub struct SecondProtocolEventStream {
event_receiver: fidl::client::EventReceiver,
}
impl std::marker::Unpin for SecondProtocolEventStream {}
impl futures::stream::FusedStream for SecondProtocolEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for SecondProtocolEventStream {
type Item = Result<SecondProtocolEvent, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
let buf = match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
&mut self.event_receiver,
cx
)?) {
Some(buf) => buf,
None => return std::task::Poll::Ready(None),
};
std::task::Poll::Ready(Some(SecondProtocolEvent::decode(buf)))
}
}
#[derive(Debug)]
pub enum SecondProtocolEvent {}
impl SecondProtocolEvent {
fn decode(mut buf: fidl::MessageBufEtc) -> Result<SecondProtocolEvent, fidl::Error> {
let (bytes, _handles) = buf.split_mut();
let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
match tx_header.ordinal() {
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal(),
protocol_name:
<SecondProtocolMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
/// A Stream of incoming requests for SecondProtocol
pub struct SecondProtocolRequestStream {
inner: std::sync::Arc<fidl::ServeInner>,
is_terminated: bool,
}
impl std::marker::Unpin for SecondProtocolRequestStream {}
impl futures::stream::FusedStream for SecondProtocolRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for SecondProtocolRequestStream {
type Protocol = SecondProtocolMarker;
type ControlHandle = SecondProtocolControlHandle;
fn from_channel(channel: fidl::AsyncChannel) -> Self {
Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
}
fn control_handle(&self) -> Self::ControlHandle {
SecondProtocolControlHandle { inner: self.inner.clone() }
}
fn into_inner(self) -> (::std::sync::Arc<fidl::ServeInner>, bool) {
(self.inner, self.is_terminated)
}
fn from_inner(inner: std::sync::Arc<fidl::ServeInner>, is_terminated: bool) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for SecondProtocolRequestStream {
type Item = Result<SecondProtocolRequest, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
let this = &mut *self;
if this.inner.poll_shutdown(cx) {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
if this.is_terminated {
panic!("polled SecondProtocolRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf(|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(e))))
}
}
// A message has been received from the channel
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
if !header.is_compatible() {
return std::task::Poll::Ready(Some(Err(fidl::Error::IncompatibleMagicNumber(
header.magic_number(),
))));
}
std::task::Poll::Ready(Some(match header.ordinal() {
0x70b439758de25c44 => {
let mut req: () = fidl::encoding::Decodable::new_empty();
fidl::duration_begin!("fidl", "decode", "bindings" => _FIDL_TRACE_BINDINGS_RUST, "name" => "test.service/SecondProtocolMethodOnSecondRequest");
fidl::trace_blob!("fidl:blob", "decode", bytes);
fidl::encoding::Decoder::decode_into(&header, _body_bytes, handles, &mut req)?;
fidl::duration_end!("fidl", "decode", "bindings" => _FIDL_TRACE_BINDINGS_RUST, "size" => bytes.len() as u32, "handle_count" => handles.len() as u32);
let control_handle = SecondProtocolControlHandle { inner: this.inner.clone() };
Ok(SecondProtocolRequest::MethodOnSecond { control_handle })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal(),
protocol_name:
<SecondProtocolMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
})
}
}
#[derive(Debug)]
pub enum SecondProtocolRequest {
MethodOnSecond { control_handle: SecondProtocolControlHandle },
}
impl SecondProtocolRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_method_on_second(self) -> Option<(SecondProtocolControlHandle)> {
if let SecondProtocolRequest::MethodOnSecond { control_handle } = self {
Some((control_handle))
} else {
None
}
}
/// Name of the method defined in FIDL
pub fn method_name(&self) -> &'static str {
match *self {
SecondProtocolRequest::MethodOnSecond { .. } => "method_on_second",
}
}
}
#[derive(Debug, Clone)]
pub struct SecondProtocolControlHandle {
inner: std::sync::Arc<fidl::ServeInner>,
}
impl fidl::endpoints::ControlHandle for SecondProtocolControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
}
impl SecondProtocolControlHandle {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct EmptyServiceMarker;
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceMarker for EmptyServiceMarker {
type Proxy = EmptyServiceProxy;
type Request = EmptyServiceRequest;
const SERVICE_NAME: &'static str = "test.service.EmptyService";
}
/// A request for one of the member protocols of EmptyService.
///
#[cfg(target_os = "fuchsia")]
pub enum EmptyServiceRequest {}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceRequest for EmptyServiceRequest {
type Service = EmptyServiceMarker;
fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
match name {
_ => panic!("no such member protocol name for service EmptyService"),
}
}
fn member_names() -> &'static [&'static str] {
&[]
}
}
#[cfg(target_os = "fuchsia")]
pub struct EmptyServiceProxy(Box<dyn fidl::endpoints::MemberOpener>);
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceProxy for EmptyServiceProxy {
type Service = EmptyServiceMarker;
fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
Self(opener)
}
}
#[cfg(target_os = "fuchsia")]
impl EmptyServiceProxy {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct MultiHeterogeneousMemberServiceMarker;
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceMarker for MultiHeterogeneousMemberServiceMarker {
type Proxy = MultiHeterogeneousMemberServiceProxy;
type Request = MultiHeterogeneousMemberServiceRequest;
const SERVICE_NAME: &'static str = "test.service.MultiHeterogeneousMemberService";
}
/// A request for one of the member protocols of MultiHeterogeneousMemberService.
///
#[cfg(target_os = "fuchsia")]
pub enum MultiHeterogeneousMemberServiceRequest {
FirstMember(FirstProtocolRequestStream),
SecondMember(SecondProtocolRequestStream),
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceRequest for MultiHeterogeneousMemberServiceRequest {
type Service = MultiHeterogeneousMemberServiceMarker;
fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
match name {
"first_member" => Self::FirstMember(
<FirstProtocolRequestStream as fidl::endpoints::RequestStream>::from_channel(
_channel,
),
),
"second_member" => Self::SecondMember(
<SecondProtocolRequestStream as fidl::endpoints::RequestStream>::from_channel(
_channel,
),
),
_ => panic!("no such member protocol name for service MultiHeterogeneousMemberService"),
}
}
fn member_names() -> &'static [&'static str] {
&["first_member", "second_member"]
}
}
#[cfg(target_os = "fuchsia")]
pub struct MultiHeterogeneousMemberServiceProxy(Box<dyn fidl::endpoints::MemberOpener>);
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceProxy for MultiHeterogeneousMemberServiceProxy {
type Service = MultiHeterogeneousMemberServiceMarker;
fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
Self(opener)
}
}
#[cfg(target_os = "fuchsia")]
impl MultiHeterogeneousMemberServiceProxy {
pub fn r#first_member(&self) -> Result<FirstProtocolProxy, fidl::Error> {
let (proxy, server) = zx::Channel::create().map_err(fidl::Error::ChannelPairCreate)?;
self.0.open_member("first_member", server)?;
let proxy = fidl::AsyncChannel::from_channel(proxy).map_err(fidl::Error::AsyncChannel)?;
Ok(FirstProtocolProxy::new(proxy))
}
pub fn r#second_member(&self) -> Result<SecondProtocolProxy, fidl::Error> {
let (proxy, server) = zx::Channel::create().map_err(fidl::Error::ChannelPairCreate)?;
self.0.open_member("second_member", server)?;
let proxy = fidl::AsyncChannel::from_channel(proxy).map_err(fidl::Error::AsyncChannel)?;
Ok(SecondProtocolProxy::new(proxy))
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct MultiHomogeneousMemberServiceMarker;
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceMarker for MultiHomogeneousMemberServiceMarker {
type Proxy = MultiHomogeneousMemberServiceProxy;
type Request = MultiHomogeneousMemberServiceRequest;
const SERVICE_NAME: &'static str = "test.service.MultiHomogeneousMemberService";
}
/// A request for one of the member protocols of MultiHomogeneousMemberService.
///
#[cfg(target_os = "fuchsia")]
pub enum MultiHomogeneousMemberServiceRequest {
FirstMember(FirstProtocolRequestStream),
SecondMember(FirstProtocolRequestStream),
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceRequest for MultiHomogeneousMemberServiceRequest {
type Service = MultiHomogeneousMemberServiceMarker;
fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
match name {
"first_member" => Self::FirstMember(
<FirstProtocolRequestStream as fidl::endpoints::RequestStream>::from_channel(
_channel,
),
),
"second_member" => Self::SecondMember(
<FirstProtocolRequestStream as fidl::endpoints::RequestStream>::from_channel(
_channel,
),
),
_ => panic!("no such member protocol name for service MultiHomogeneousMemberService"),
}
}
fn member_names() -> &'static [&'static str] {
&["first_member", "second_member"]
}
}
#[cfg(target_os = "fuchsia")]
pub struct MultiHomogeneousMemberServiceProxy(Box<dyn fidl::endpoints::MemberOpener>);
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceProxy for MultiHomogeneousMemberServiceProxy {
type Service = MultiHomogeneousMemberServiceMarker;
fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
Self(opener)
}
}
#[cfg(target_os = "fuchsia")]
impl MultiHomogeneousMemberServiceProxy {
pub fn r#first_member(&self) -> Result<FirstProtocolProxy, fidl::Error> {
let (proxy, server) = zx::Channel::create().map_err(fidl::Error::ChannelPairCreate)?;
self.0.open_member("first_member", server)?;
let proxy = fidl::AsyncChannel::from_channel(proxy).map_err(fidl::Error::AsyncChannel)?;
Ok(FirstProtocolProxy::new(proxy))
}
pub fn r#second_member(&self) -> Result<FirstProtocolProxy, fidl::Error> {
let (proxy, server) = zx::Channel::create().map_err(fidl::Error::ChannelPairCreate)?;
self.0.open_member("second_member", server)?;
let proxy = fidl::AsyncChannel::from_channel(proxy).map_err(fidl::Error::AsyncChannel)?;
Ok(FirstProtocolProxy::new(proxy))
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct SingleMemberServiceMarker;
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceMarker for SingleMemberServiceMarker {
type Proxy = SingleMemberServiceProxy;
type Request = SingleMemberServiceRequest;
const SERVICE_NAME: &'static str = "test.service.SingleMemberService";
}
/// A request for one of the member protocols of SingleMemberService.
///
#[cfg(target_os = "fuchsia")]
pub enum SingleMemberServiceRequest {
SingleMember(FirstProtocolRequestStream),
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceRequest for SingleMemberServiceRequest {
type Service = SingleMemberServiceMarker;
fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
match name {
"single_member" => Self::SingleMember(
<FirstProtocolRequestStream as fidl::endpoints::RequestStream>::from_channel(
_channel,
),
),
_ => panic!("no such member protocol name for service SingleMemberService"),
}
}
fn member_names() -> &'static [&'static str] {
&["single_member"]
}
}
#[cfg(target_os = "fuchsia")]
pub struct SingleMemberServiceProxy(Box<dyn fidl::endpoints::MemberOpener>);
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceProxy for SingleMemberServiceProxy {
type Service = SingleMemberServiceMarker;
fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
Self(opener)
}
}
#[cfg(target_os = "fuchsia")]
impl SingleMemberServiceProxy {
pub fn r#single_member(&self) -> Result<FirstProtocolProxy, fidl::Error> {
let (proxy, server) = zx::Channel::create().map_err(fidl::Error::ChannelPairCreate)?;
self.0.open_member("single_member", server)?;
let proxy = fidl::AsyncChannel::from_channel(proxy).map_err(fidl::Error::AsyncChannel)?;
Ok(FirstProtocolProxy::new(proxy))
}
}