blob: 9ac7e9b5f666fc5e17a8acab74e5cf044e4a7caf [file] [log] [blame] [edit]
// WARNING: This file is machine generated by fidlgen.
// fidl_experiment = no_optional_structs
// fidl_experiment = output_index_json
// fidl_experiment = unknown_interactions
// fidl_experiment = unknown_interactions_mandate
#![warn(clippy::all)]
#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
use {
bitflags::bitflags,
fidl::{
client::QueryResponseFut,
endpoints::{ControlHandle as _, Responder as _},
},
fuchsia_zircon_status as zx_status,
futures::future::{self, MaybeDone, TryFutureExt},
};
#[cfg(target_os = "fuchsia")]
use fuchsia_zircon as zx;
#[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::<fidl::encoding::EmptyPayload>(
(),
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 test.service/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 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::<fidl::encoding::EmptyPayload>(
(),
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>> {
match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
&mut self.event_receiver,
cx
)?) {
Some(buf) => std::task::Poll::Ready(Some(FirstProtocolEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum FirstProtocolEvent {}
impl FirstProtocolEvent {
/// Decodes a message buffer as a [`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)?;
debug_assert_eq!(tx_header.tx_id, 0);
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 test.service/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.check_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)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x5828c91b57492931 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload);
fidl::encoding::Decoder::decode_into::<fidl::encoding::EmptyPayload>(
&header,
_body_bytes,
handles,
&mut req,
)?;
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)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed<'a>(&'a self) -> fidl::OnSignals<'a> {
self.inner.channel().on_closed()
}
}
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::<fidl::encoding::EmptyPayload>(
(),
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 test.service/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 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::<fidl::encoding::EmptyPayload>(
(),
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>> {
match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
&mut self.event_receiver,
cx
)?) {
Some(buf) => std::task::Poll::Ready(Some(SecondProtocolEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum SecondProtocolEvent {}
impl SecondProtocolEvent {
/// Decodes a message buffer as a [`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)?;
debug_assert_eq!(tx_header.tx_id, 0);
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 test.service/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.check_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)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x70b439758de25c44 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload);
fidl::encoding::Decoder::decode_into::<fidl::encoding::EmptyPayload>(
&header,
_body_bytes,
handles,
&mut req,
)?;
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)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed<'a>(&'a self) -> fidl::OnSignals<'a> {
self.inner.channel().on_closed()
}
}
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 connect_to_first_member(&self) -> Result<FirstProtocolProxy, fidl::Error> {
let (proxy, server_end) = fidl::endpoints::create_proxy::<FirstProtocolMarker>()?;
self.connect_channel_to_first_member(server_end)?;
Ok(proxy)
}
/// Like `connect_to_first_member`, but accepts a server end.
pub fn connect_channel_to_first_member(
&self,
server_end: fidl::endpoints::ServerEnd<FirstProtocolMarker>,
) -> Result<(), fidl::Error> {
self.0.open_member("first_member", server_end.into_channel())
}
pub fn connect_to_second_member(&self) -> Result<SecondProtocolProxy, fidl::Error> {
let (proxy, server_end) = fidl::endpoints::create_proxy::<SecondProtocolMarker>()?;
self.connect_channel_to_second_member(server_end)?;
Ok(proxy)
}
/// Like `connect_to_second_member`, but accepts a server end.
pub fn connect_channel_to_second_member(
&self,
server_end: fidl::endpoints::ServerEnd<SecondProtocolMarker>,
) -> Result<(), fidl::Error> {
self.0.open_member("second_member", server_end.into_channel())
}
}
#[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 connect_to_first_member(&self) -> Result<FirstProtocolProxy, fidl::Error> {
let (proxy, server_end) = fidl::endpoints::create_proxy::<FirstProtocolMarker>()?;
self.connect_channel_to_first_member(server_end)?;
Ok(proxy)
}
/// Like `connect_to_first_member`, but accepts a server end.
pub fn connect_channel_to_first_member(
&self,
server_end: fidl::endpoints::ServerEnd<FirstProtocolMarker>,
) -> Result<(), fidl::Error> {
self.0.open_member("first_member", server_end.into_channel())
}
pub fn connect_to_second_member(&self) -> Result<FirstProtocolProxy, fidl::Error> {
let (proxy, server_end) = fidl::endpoints::create_proxy::<FirstProtocolMarker>()?;
self.connect_channel_to_second_member(server_end)?;
Ok(proxy)
}
/// Like `connect_to_second_member`, but accepts a server end.
pub fn connect_channel_to_second_member(
&self,
server_end: fidl::endpoints::ServerEnd<FirstProtocolMarker>,
) -> Result<(), fidl::Error> {
self.0.open_member("second_member", server_end.into_channel())
}
}
#[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 connect_to_single_member(&self) -> Result<FirstProtocolProxy, fidl::Error> {
let (proxy, server_end) = fidl::endpoints::create_proxy::<FirstProtocolMarker>()?;
self.connect_channel_to_single_member(server_end)?;
Ok(proxy)
}
/// Like `connect_to_single_member`, but accepts a server end.
pub fn connect_channel_to_single_member(
&self,
server_end: fidl::endpoints::ServerEnd<FirstProtocolMarker>,
) -> Result<(), fidl::Error> {
self.0.open_member("single_member", server_end.into_channel())
}
}
mod internal {
use super::*;
}