| // DO NOT EDIT: This file is machine-generated by fidlgen |
| #![warn(clippy::all)] |
| #![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)] |
| |
| /// The type corresponding to the Child protocol. |
| #[derive(PartialEq, Debug)] |
| pub struct Child; |
| |
| pub mod child { |
| pub mod prelude { |
| pub use crate::{Child, ChildClientHandler, ChildServerHandler, child}; |
| } |
| |
| mod ___detail { |
| |
| unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::Child |
| where |
| ___T: ::fidl_next::Transport, |
| { |
| type Client = ChildClient<___T>; |
| type Server = ChildServer<___T>; |
| } |
| |
| /// The client for the `Child` protocol. |
| #[repr(transparent)] |
| pub struct ChildClient<___T: ::fidl_next::Transport> { |
| #[allow(dead_code)] |
| client: ::fidl_next::protocol::Client<___T>, |
| } |
| |
| impl<___T> ChildClient<___T> where ___T: ::fidl_next::Transport {} |
| |
| /// The server for the `Child` protocol. |
| #[repr(transparent)] |
| pub struct ChildServer<___T: ::fidl_next::Transport> { |
| server: ::fidl_next::protocol::Server<___T>, |
| } |
| |
| impl<___T> ChildServer<___T> where ___T: ::fidl_next::Transport {} |
| } |
| } |
| |
| /// A client handler for the Child protocol. |
| /// |
| /// See [`Child`] for more details. |
| pub trait ChildClientHandler< |
| #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport, |
| #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel, |
| > |
| { |
| } |
| |
| impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Child |
| where |
| ___H: ChildClientHandler<___T> + ::core::marker::Send, |
| ___T: ::fidl_next::Transport, |
| { |
| async fn on_event( |
| handler: &mut ___H, |
| client: &::fidl_next::Client<Self, ___T>, |
| ordinal: u64, |
| buffer: ___T::RecvBuffer, |
| ) { |
| match ordinal { |
| ordinal => client.close(), |
| } |
| } |
| } |
| |
| /// A server handler for the Child protocol. |
| /// |
| /// See [`Child`] for more details. |
| pub trait ChildServerHandler< |
| #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport, |
| #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel, |
| > |
| { |
| } |
| |
| impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Child |
| where |
| ___H: ChildServerHandler<___T> + ::core::marker::Send, |
| ___T: ::fidl_next::Transport, |
| { |
| async fn on_one_way( |
| handler: &mut ___H, |
| server: &::fidl_next::Server<Self, ___T>, |
| ordinal: u64, |
| buffer: ___T::RecvBuffer, |
| ) { |
| match ordinal { |
| ordinal => server.close(), |
| } |
| } |
| |
| async fn on_two_way( |
| handler: &mut ___H, |
| ordinal: u64, |
| buffer: ___T::RecvBuffer, |
| responder: ::fidl_next::protocol::Responder<___T>, |
| ) { |
| match ordinal { |
| ordinal => responder.server().close(), |
| } |
| } |
| } |
| |
| #[derive(PartialEq, Debug)] |
| #[repr(C)] |
| pub struct ParentGetChildResponse { |
| pub c: ::fidl_next::ClientEnd<crate::Child, ::fidl_next::fuchsia::zx::Channel>, |
| } |
| |
| impl ::fidl_next::Encodable for ParentGetChildResponse { |
| const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireParentGetChildResponse> = unsafe { |
| ::fidl_next::CopyOptimization::enable_if( |
| true |
| |
| && < |
| ::fidl_next::ClientEnd<crate::Child, ::fidl_next::fuchsia::zx::Channel> as ::fidl_next::Encodable |
| >::COPY_OPTIMIZATION.is_enabled() |
| |
| ) |
| }; |
| |
| type Encoded = WireParentGetChildResponse; |
| } |
| |
| unsafe impl<___E> ::fidl_next::Encode<___E> for ParentGetChildResponse |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| ___E: ::fidl_next::fuchsia::HandleEncoder, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<Self::Encoded>, |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let Self::Encoded { |
| c, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(self.c, encoder_, c)?; |
| |
| Ok(()) |
| } |
| } |
| |
| impl ::fidl_next::EncodableOption for ParentGetChildResponse { |
| type EncodedOption = ::fidl_next::WireBox<'static, WireParentGetChildResponse>; |
| } |
| |
| unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ParentGetChildResponse |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| ParentGetChildResponse: ::fidl_next::Encode<___E>, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>, |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| if let Some(inner) = this { |
| ::fidl_next::EncoderExt::encode_next(encoder, inner)?; |
| ::fidl_next::WireBox::encode_present(out); |
| } else { |
| ::fidl_next::WireBox::encode_absent(out); |
| } |
| |
| Ok(()) |
| } |
| } |
| |
| impl ::fidl_next::FromWire<WireParentGetChildResponse> for ParentGetChildResponse { |
| const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireParentGetChildResponse, Self> = unsafe { |
| ::fidl_next::CopyOptimization::enable_if( |
| true |
| |
| && < |
| ::fidl_next::ClientEnd<crate::Child, ::fidl_next::fuchsia::zx::Channel> as ::fidl_next::FromWire<::fidl_next::ClientEnd<crate::Child, ::fidl_next::fuchsia::WireChannel>> |
| >::COPY_OPTIMIZATION.is_enabled() |
| |
| ) |
| }; |
| |
| #[inline] |
| fn from_wire(wire: WireParentGetChildResponse) -> Self { |
| Self { c: ::fidl_next::FromWire::from_wire(wire.c) } |
| } |
| } |
| |
| impl ::fidl_next::IntoNatural for WireParentGetChildResponse { |
| type Natural = ParentGetChildResponse; |
| } |
| |
| /// The wire type corresponding to [`ParentGetChildResponse`]. |
| #[derive(Debug)] |
| #[repr(C)] |
| pub struct WireParentGetChildResponse { |
| pub c: ::fidl_next::ClientEnd<crate::Child, ::fidl_next::fuchsia::WireChannel>, |
| } |
| |
| unsafe impl ::fidl_next::Wire for WireParentGetChildResponse { |
| type Decoded<'de> = WireParentGetChildResponse; |
| |
| #[inline] |
| fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) { |
| ::fidl_next::munge! { |
| let Self { |
| c, |
| |
| } = &mut *out_; |
| } |
| |
| ::fidl_next::Wire::zero_padding(c); |
| } |
| } |
| |
| unsafe impl<___D> ::fidl_next::Decode<___D> for WireParentGetChildResponse |
| where |
| ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized, |
| ___D: ::fidl_next::fuchsia::HandleDecoder, |
| { |
| fn decode( |
| slot_: ::fidl_next::Slot<'_, Self>, |
| decoder_: &mut ___D, |
| ) -> ::core::result::Result<(), ::fidl_next::DecodeError> { |
| ::fidl_next::munge! { |
| let Self { |
| mut c, |
| |
| } = slot_; |
| } |
| |
| ::fidl_next::Decode::decode(c.as_mut(), decoder_)?; |
| |
| Ok(()) |
| } |
| } |
| |
| #[derive(PartialEq, Debug)] |
| #[repr(C)] |
| pub struct ParentGetChildRequestResponse { |
| pub r: ::fidl_next::ServerEnd<crate::Child, ::fidl_next::fuchsia::zx::Channel>, |
| } |
| |
| impl ::fidl_next::Encodable for ParentGetChildRequestResponse { |
| const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization< |
| Self, |
| WireParentGetChildRequestResponse, |
| > = unsafe { |
| ::fidl_next::CopyOptimization::enable_if( |
| true |
| |
| && < |
| ::fidl_next::ServerEnd<crate::Child, ::fidl_next::fuchsia::zx::Channel> as ::fidl_next::Encodable |
| >::COPY_OPTIMIZATION.is_enabled() |
| |
| ) |
| }; |
| |
| type Encoded = WireParentGetChildRequestResponse; |
| } |
| |
| unsafe impl<___E> ::fidl_next::Encode<___E> for ParentGetChildRequestResponse |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| ___E: ::fidl_next::fuchsia::HandleEncoder, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<Self::Encoded>, |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let Self::Encoded { |
| r, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(self.r, encoder_, r)?; |
| |
| Ok(()) |
| } |
| } |
| |
| impl ::fidl_next::EncodableOption for ParentGetChildRequestResponse { |
| type EncodedOption = ::fidl_next::WireBox<'static, WireParentGetChildRequestResponse>; |
| } |
| |
| unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ParentGetChildRequestResponse |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| ParentGetChildRequestResponse: ::fidl_next::Encode<___E>, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>, |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| if let Some(inner) = this { |
| ::fidl_next::EncoderExt::encode_next(encoder, inner)?; |
| ::fidl_next::WireBox::encode_present(out); |
| } else { |
| ::fidl_next::WireBox::encode_absent(out); |
| } |
| |
| Ok(()) |
| } |
| } |
| |
| impl ::fidl_next::FromWire<WireParentGetChildRequestResponse> for ParentGetChildRequestResponse { |
| const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization< |
| WireParentGetChildRequestResponse, |
| Self, |
| > = unsafe { |
| ::fidl_next::CopyOptimization::enable_if( |
| true |
| |
| && < |
| ::fidl_next::ServerEnd<crate::Child, ::fidl_next::fuchsia::zx::Channel> as ::fidl_next::FromWire<::fidl_next::ServerEnd<crate::Child, ::fidl_next::fuchsia::WireChannel>> |
| >::COPY_OPTIMIZATION.is_enabled() |
| |
| ) |
| }; |
| |
| #[inline] |
| fn from_wire(wire: WireParentGetChildRequestResponse) -> Self { |
| Self { r: ::fidl_next::FromWire::from_wire(wire.r) } |
| } |
| } |
| |
| impl ::fidl_next::IntoNatural for WireParentGetChildRequestResponse { |
| type Natural = ParentGetChildRequestResponse; |
| } |
| |
| /// The wire type corresponding to [`ParentGetChildRequestResponse`]. |
| #[derive(Debug)] |
| #[repr(C)] |
| pub struct WireParentGetChildRequestResponse { |
| pub r: ::fidl_next::ServerEnd<crate::Child, ::fidl_next::fuchsia::WireChannel>, |
| } |
| |
| unsafe impl ::fidl_next::Wire for WireParentGetChildRequestResponse { |
| type Decoded<'de> = WireParentGetChildRequestResponse; |
| |
| #[inline] |
| fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) { |
| ::fidl_next::munge! { |
| let Self { |
| r, |
| |
| } = &mut *out_; |
| } |
| |
| ::fidl_next::Wire::zero_padding(r); |
| } |
| } |
| |
| unsafe impl<___D> ::fidl_next::Decode<___D> for WireParentGetChildRequestResponse |
| where |
| ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized, |
| ___D: ::fidl_next::fuchsia::HandleDecoder, |
| { |
| fn decode( |
| slot_: ::fidl_next::Slot<'_, Self>, |
| decoder_: &mut ___D, |
| ) -> ::core::result::Result<(), ::fidl_next::DecodeError> { |
| ::fidl_next::munge! { |
| let Self { |
| mut r, |
| |
| } = slot_; |
| } |
| |
| ::fidl_next::Decode::decode(r.as_mut(), decoder_)?; |
| |
| Ok(()) |
| } |
| } |
| |
| #[derive(PartialEq, Debug)] |
| #[repr(C)] |
| pub struct ParentTakeChildRequest { |
| pub c: ::fidl_next::ClientEnd<crate::Child, ::fidl_next::fuchsia::zx::Channel>, |
| } |
| |
| impl ::fidl_next::Encodable for ParentTakeChildRequest { |
| const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireParentTakeChildRequest> = unsafe { |
| ::fidl_next::CopyOptimization::enable_if( |
| true |
| |
| && < |
| ::fidl_next::ClientEnd<crate::Child, ::fidl_next::fuchsia::zx::Channel> as ::fidl_next::Encodable |
| >::COPY_OPTIMIZATION.is_enabled() |
| |
| ) |
| }; |
| |
| type Encoded = WireParentTakeChildRequest; |
| } |
| |
| unsafe impl<___E> ::fidl_next::Encode<___E> for ParentTakeChildRequest |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| ___E: ::fidl_next::fuchsia::HandleEncoder, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<Self::Encoded>, |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let Self::Encoded { |
| c, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(self.c, encoder_, c)?; |
| |
| Ok(()) |
| } |
| } |
| |
| impl ::fidl_next::EncodableOption for ParentTakeChildRequest { |
| type EncodedOption = ::fidl_next::WireBox<'static, WireParentTakeChildRequest>; |
| } |
| |
| unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ParentTakeChildRequest |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| ParentTakeChildRequest: ::fidl_next::Encode<___E>, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>, |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| if let Some(inner) = this { |
| ::fidl_next::EncoderExt::encode_next(encoder, inner)?; |
| ::fidl_next::WireBox::encode_present(out); |
| } else { |
| ::fidl_next::WireBox::encode_absent(out); |
| } |
| |
| Ok(()) |
| } |
| } |
| |
| impl ::fidl_next::FromWire<WireParentTakeChildRequest> for ParentTakeChildRequest { |
| const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireParentTakeChildRequest, Self> = unsafe { |
| ::fidl_next::CopyOptimization::enable_if( |
| true |
| |
| && < |
| ::fidl_next::ClientEnd<crate::Child, ::fidl_next::fuchsia::zx::Channel> as ::fidl_next::FromWire<::fidl_next::ClientEnd<crate::Child, ::fidl_next::fuchsia::WireChannel>> |
| >::COPY_OPTIMIZATION.is_enabled() |
| |
| ) |
| }; |
| |
| #[inline] |
| fn from_wire(wire: WireParentTakeChildRequest) -> Self { |
| Self { c: ::fidl_next::FromWire::from_wire(wire.c) } |
| } |
| } |
| |
| impl ::fidl_next::IntoNatural for WireParentTakeChildRequest { |
| type Natural = ParentTakeChildRequest; |
| } |
| |
| /// The wire type corresponding to [`ParentTakeChildRequest`]. |
| #[derive(Debug)] |
| #[repr(C)] |
| pub struct WireParentTakeChildRequest { |
| pub c: ::fidl_next::ClientEnd<crate::Child, ::fidl_next::fuchsia::WireChannel>, |
| } |
| |
| unsafe impl ::fidl_next::Wire for WireParentTakeChildRequest { |
| type Decoded<'de> = WireParentTakeChildRequest; |
| |
| #[inline] |
| fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) { |
| ::fidl_next::munge! { |
| let Self { |
| c, |
| |
| } = &mut *out_; |
| } |
| |
| ::fidl_next::Wire::zero_padding(c); |
| } |
| } |
| |
| unsafe impl<___D> ::fidl_next::Decode<___D> for WireParentTakeChildRequest |
| where |
| ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized, |
| ___D: ::fidl_next::fuchsia::HandleDecoder, |
| { |
| fn decode( |
| slot_: ::fidl_next::Slot<'_, Self>, |
| decoder_: &mut ___D, |
| ) -> ::core::result::Result<(), ::fidl_next::DecodeError> { |
| ::fidl_next::munge! { |
| let Self { |
| mut c, |
| |
| } = slot_; |
| } |
| |
| ::fidl_next::Decode::decode(c.as_mut(), decoder_)?; |
| |
| Ok(()) |
| } |
| } |
| |
| #[derive(PartialEq, Debug)] |
| #[repr(C)] |
| pub struct ParentTakeChildRequestRequest { |
| pub r: ::fidl_next::ServerEnd<crate::Child, ::fidl_next::fuchsia::zx::Channel>, |
| } |
| |
| impl ::fidl_next::Encodable for ParentTakeChildRequestRequest { |
| const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization< |
| Self, |
| WireParentTakeChildRequestRequest, |
| > = unsafe { |
| ::fidl_next::CopyOptimization::enable_if( |
| true |
| |
| && < |
| ::fidl_next::ServerEnd<crate::Child, ::fidl_next::fuchsia::zx::Channel> as ::fidl_next::Encodable |
| >::COPY_OPTIMIZATION.is_enabled() |
| |
| ) |
| }; |
| |
| type Encoded = WireParentTakeChildRequestRequest; |
| } |
| |
| unsafe impl<___E> ::fidl_next::Encode<___E> for ParentTakeChildRequestRequest |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| ___E: ::fidl_next::fuchsia::HandleEncoder, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<Self::Encoded>, |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let Self::Encoded { |
| r, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(self.r, encoder_, r)?; |
| |
| Ok(()) |
| } |
| } |
| |
| impl ::fidl_next::EncodableOption for ParentTakeChildRequestRequest { |
| type EncodedOption = ::fidl_next::WireBox<'static, WireParentTakeChildRequestRequest>; |
| } |
| |
| unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ParentTakeChildRequestRequest |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| ParentTakeChildRequestRequest: ::fidl_next::Encode<___E>, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>, |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| if let Some(inner) = this { |
| ::fidl_next::EncoderExt::encode_next(encoder, inner)?; |
| ::fidl_next::WireBox::encode_present(out); |
| } else { |
| ::fidl_next::WireBox::encode_absent(out); |
| } |
| |
| Ok(()) |
| } |
| } |
| |
| impl ::fidl_next::FromWire<WireParentTakeChildRequestRequest> for ParentTakeChildRequestRequest { |
| const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization< |
| WireParentTakeChildRequestRequest, |
| Self, |
| > = unsafe { |
| ::fidl_next::CopyOptimization::enable_if( |
| true |
| |
| && < |
| ::fidl_next::ServerEnd<crate::Child, ::fidl_next::fuchsia::zx::Channel> as ::fidl_next::FromWire<::fidl_next::ServerEnd<crate::Child, ::fidl_next::fuchsia::WireChannel>> |
| >::COPY_OPTIMIZATION.is_enabled() |
| |
| ) |
| }; |
| |
| #[inline] |
| fn from_wire(wire: WireParentTakeChildRequestRequest) -> Self { |
| Self { r: ::fidl_next::FromWire::from_wire(wire.r) } |
| } |
| } |
| |
| impl ::fidl_next::IntoNatural for WireParentTakeChildRequestRequest { |
| type Natural = ParentTakeChildRequestRequest; |
| } |
| |
| /// The wire type corresponding to [`ParentTakeChildRequestRequest`]. |
| #[derive(Debug)] |
| #[repr(C)] |
| pub struct WireParentTakeChildRequestRequest { |
| pub r: ::fidl_next::ServerEnd<crate::Child, ::fidl_next::fuchsia::WireChannel>, |
| } |
| |
| unsafe impl ::fidl_next::Wire for WireParentTakeChildRequestRequest { |
| type Decoded<'de> = WireParentTakeChildRequestRequest; |
| |
| #[inline] |
| fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) { |
| ::fidl_next::munge! { |
| let Self { |
| r, |
| |
| } = &mut *out_; |
| } |
| |
| ::fidl_next::Wire::zero_padding(r); |
| } |
| } |
| |
| unsafe impl<___D> ::fidl_next::Decode<___D> for WireParentTakeChildRequestRequest |
| where |
| ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized, |
| ___D: ::fidl_next::fuchsia::HandleDecoder, |
| { |
| fn decode( |
| slot_: ::fidl_next::Slot<'_, Self>, |
| decoder_: &mut ___D, |
| ) -> ::core::result::Result<(), ::fidl_next::DecodeError> { |
| ::fidl_next::munge! { |
| let Self { |
| mut r, |
| |
| } = slot_; |
| } |
| |
| ::fidl_next::Decode::decode(r.as_mut(), decoder_)?; |
| |
| Ok(()) |
| } |
| } |
| |
| /// The type corresponding to the Parent protocol. |
| #[derive(PartialEq, Debug)] |
| pub struct Parent; |
| |
| pub mod parent { |
| pub mod prelude { |
| pub use crate::{Parent, ParentClientHandler, ParentServerHandler, parent}; |
| |
| pub use crate::ParentGetChildRequestResponse; |
| |
| pub use crate::ParentGetChildResponse; |
| |
| pub use crate::ParentTakeChildRequest; |
| |
| pub use crate::ParentTakeChildRequestRequest; |
| } |
| |
| pub struct GetChild; |
| |
| impl ::fidl_next::Method for GetChild { |
| const ORDINAL: u64 = 881818649151440699; |
| |
| type Protocol = crate::Parent; |
| |
| type Request = (); |
| |
| type Response = crate::WireParentGetChildResponse; |
| } |
| |
| pub struct GetChildRequest; |
| |
| impl ::fidl_next::Method for GetChildRequest { |
| const ORDINAL: u64 = 1096855814967598201; |
| |
| type Protocol = crate::Parent; |
| |
| type Request = (); |
| |
| type Response = crate::WireParentGetChildRequestResponse; |
| } |
| |
| pub struct TakeChild; |
| |
| impl ::fidl_next::Method for TakeChild { |
| const ORDINAL: u64 = 4470101341872267920; |
| |
| type Protocol = crate::Parent; |
| |
| type Request = crate::WireParentTakeChildRequest; |
| |
| type Response = ::fidl_next::Never; |
| } |
| |
| pub struct TakeChildRequest; |
| |
| impl ::fidl_next::Method for TakeChildRequest { |
| const ORDINAL: u64 = 2333981071306416007; |
| |
| type Protocol = crate::Parent; |
| |
| type Request = crate::WireParentTakeChildRequestRequest; |
| |
| type Response = ::fidl_next::Never; |
| } |
| |
| mod ___detail { |
| |
| pub struct TakeChild<T0> { |
| c: T0, |
| } |
| |
| impl<T0> ::fidl_next::Encodable for TakeChild<T0> |
| where |
| T0: ::fidl_next::Encodable< |
| Encoded = ::fidl_next::ClientEnd< |
| crate::Child, |
| ::fidl_next::fuchsia::WireChannel, |
| >, |
| >, |
| { |
| type Encoded = crate::WireParentTakeChildRequest; |
| } |
| |
| unsafe impl<___E, T0> ::fidl_next::Encode<___E> for TakeChild<T0> |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| ___E: ::fidl_next::fuchsia::HandleEncoder, |
| T0: ::fidl_next::Encode< |
| ___E, |
| Encoded = ::fidl_next::ClientEnd< |
| crate::Child, |
| ::fidl_next::fuchsia::WireChannel, |
| >, |
| >, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<Self::Encoded>, |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let Self::Encoded { |
| c, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(self.c, encoder_, c)?; |
| |
| Ok(()) |
| } |
| } |
| |
| pub struct TakeChildRequest<T0> { |
| r: T0, |
| } |
| |
| impl<T0> ::fidl_next::Encodable for TakeChildRequest<T0> |
| where |
| T0: ::fidl_next::Encodable< |
| Encoded = ::fidl_next::ServerEnd< |
| crate::Child, |
| ::fidl_next::fuchsia::WireChannel, |
| >, |
| >, |
| { |
| type Encoded = crate::WireParentTakeChildRequestRequest; |
| } |
| |
| unsafe impl<___E, T0> ::fidl_next::Encode<___E> for TakeChildRequest<T0> |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| ___E: ::fidl_next::fuchsia::HandleEncoder, |
| T0: ::fidl_next::Encode< |
| ___E, |
| Encoded = ::fidl_next::ServerEnd< |
| crate::Child, |
| ::fidl_next::fuchsia::WireChannel, |
| >, |
| >, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<Self::Encoded>, |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let Self::Encoded { |
| r, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(self.r, encoder_, r)?; |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::Parent |
| where |
| ___T: ::fidl_next::Transport, |
| { |
| type Client = ParentClient<___T>; |
| type Server = ParentServer<___T>; |
| } |
| |
| /// The client for the `Parent` protocol. |
| #[repr(transparent)] |
| pub struct ParentClient<___T: ::fidl_next::Transport> { |
| #[allow(dead_code)] |
| client: ::fidl_next::protocol::Client<___T>, |
| } |
| |
| impl<___T> ParentClient<___T> |
| where |
| ___T: ::fidl_next::Transport, |
| { |
| pub fn get_child(&self) -> ::fidl_next::TwoWayFuture<'_, super::GetChild, ___T> { |
| ::fidl_next::TwoWayFuture::from_untyped( |
| self.client.send_two_way(881818649151440699, ()), |
| ) |
| } |
| |
| pub fn get_child_request( |
| &self, |
| ) -> ::fidl_next::TwoWayFuture<'_, super::GetChildRequest, ___T> { |
| ::fidl_next::TwoWayFuture::from_untyped( |
| self.client.send_two_way(1096855814967598201, ()), |
| ) |
| } |
| |
| pub fn take_child( |
| &self, |
| |
| c: impl ::fidl_next::Encode< |
| <___T as ::fidl_next::Transport>::SendBuffer, |
| Encoded = ::fidl_next::ClientEnd< |
| crate::Child, |
| ::fidl_next::fuchsia::WireChannel, |
| >, |
| >, |
| ) -> ::fidl_next::SendFuture<'_, ___T> |
| where |
| <___T as ::fidl_next::Transport>::SendBuffer: |
| ::fidl_next::encoder::InternalHandleEncoder, |
| <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder, |
| { |
| self.take_child_with(TakeChild { c }) |
| } |
| |
| pub fn take_child_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T> |
| where |
| ___R: ::fidl_next::Encode< |
| <___T as ::fidl_next::Transport>::SendBuffer, |
| Encoded = crate::WireParentTakeChildRequest, |
| >, |
| { |
| ::fidl_next::SendFuture::from_untyped( |
| self.client.send_one_way(4470101341872267920, request), |
| ) |
| } |
| |
| pub fn take_child_request( |
| &self, |
| |
| r: impl ::fidl_next::Encode< |
| <___T as ::fidl_next::Transport>::SendBuffer, |
| Encoded = ::fidl_next::ServerEnd< |
| crate::Child, |
| ::fidl_next::fuchsia::WireChannel, |
| >, |
| >, |
| ) -> ::fidl_next::SendFuture<'_, ___T> |
| where |
| <___T as ::fidl_next::Transport>::SendBuffer: |
| ::fidl_next::encoder::InternalHandleEncoder, |
| <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder, |
| { |
| self.take_child_request_with(TakeChildRequest { r }) |
| } |
| |
| pub fn take_child_request_with<___R>( |
| &self, |
| request: ___R, |
| ) -> ::fidl_next::SendFuture<'_, ___T> |
| where |
| ___R: ::fidl_next::Encode< |
| <___T as ::fidl_next::Transport>::SendBuffer, |
| Encoded = crate::WireParentTakeChildRequestRequest, |
| >, |
| { |
| ::fidl_next::SendFuture::from_untyped( |
| self.client.send_one_way(2333981071306416007, request), |
| ) |
| } |
| } |
| |
| /// The server for the `Parent` protocol. |
| #[repr(transparent)] |
| pub struct ParentServer<___T: ::fidl_next::Transport> { |
| server: ::fidl_next::protocol::Server<___T>, |
| } |
| |
| impl<___T> ParentServer<___T> where ___T: ::fidl_next::Transport {} |
| } |
| } |
| |
| /// A client handler for the Parent protocol. |
| /// |
| /// See [`Parent`] for more details. |
| pub trait ParentClientHandler< |
| #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport, |
| #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel, |
| > |
| { |
| } |
| |
| impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Parent |
| where |
| ___H: ParentClientHandler<___T> + ::core::marker::Send, |
| ___T: ::fidl_next::Transport, |
| <parent::GetChild as ::fidl_next::Method>::Response: |
| ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>, |
| <parent::GetChildRequest as ::fidl_next::Method>::Response: |
| ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>, |
| { |
| async fn on_event( |
| handler: &mut ___H, |
| client: &::fidl_next::Client<Self, ___T>, |
| ordinal: u64, |
| buffer: ___T::RecvBuffer, |
| ) { |
| match ordinal { |
| ordinal => client.close(), |
| } |
| } |
| } |
| |
| /// A server handler for the Parent protocol. |
| /// |
| /// See [`Parent`] for more details. |
| pub trait ParentServerHandler< |
| #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport, |
| #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel, |
| > |
| { |
| fn get_child( |
| &mut self, |
| |
| responder: ::fidl_next::Responder<parent::GetChild, ___T>, |
| ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send; |
| |
| fn get_child_request( |
| &mut self, |
| |
| responder: ::fidl_next::Responder<parent::GetChildRequest, ___T>, |
| ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send; |
| |
| fn take_child( |
| &mut self, |
| server: &::fidl_next::Server<Parent, ___T>, |
| |
| request: ::fidl_next::Request<parent::TakeChild, ___T>, |
| ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send; |
| |
| fn take_child_request( |
| &mut self, |
| server: &::fidl_next::Server<Parent, ___T>, |
| |
| request: ::fidl_next::Request<parent::TakeChildRequest, ___T>, |
| ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send; |
| } |
| |
| impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Parent |
| where |
| ___H: ParentServerHandler<___T> + ::core::marker::Send, |
| ___T: ::fidl_next::Transport, |
| <parent::TakeChild as ::fidl_next::Method>::Request: |
| ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>, |
| <parent::TakeChildRequest as ::fidl_next::Method>::Request: |
| ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>, |
| { |
| async fn on_one_way( |
| handler: &mut ___H, |
| server: &::fidl_next::Server<Self, ___T>, |
| ordinal: u64, |
| buffer: ___T::RecvBuffer, |
| ) { |
| match ordinal { |
| 4470101341872267920 => match ::fidl_next::DecoderExt::decode(buffer) { |
| Ok(decoded) => handler.take_child(server, decoded).await, |
| Err(e) => server.close(), |
| }, |
| |
| 2333981071306416007 => match ::fidl_next::DecoderExt::decode(buffer) { |
| Ok(decoded) => handler.take_child_request(server, decoded).await, |
| Err(e) => server.close(), |
| }, |
| |
| ordinal => server.close(), |
| } |
| } |
| |
| async fn on_two_way( |
| handler: &mut ___H, |
| ordinal: u64, |
| buffer: ___T::RecvBuffer, |
| responder: ::fidl_next::protocol::Responder<___T>, |
| ) { |
| match ordinal { |
| 881818649151440699 => { |
| let responder = ::fidl_next::Responder::from_untyped(responder); |
| |
| handler.get_child(responder).await; |
| } |
| |
| 1096855814967598201 => { |
| let responder = ::fidl_next::Responder::from_untyped(responder); |
| |
| handler.get_child_request(responder).await; |
| } |
| |
| ordinal => responder.server().close(), |
| } |
| } |
| } |
| |
| /// Compatibility shims which mimic some API surfaces of the current Rust bindings. |
| pub mod compat { |
| |
| #[cfg(target_os = "fuchsia")] |
| /// An alias for a client over `zx::Channel` for the `Child` |
| /// protocol. |
| pub type ChildProxy = ::fidl_next::Client<crate::Child>; |
| |
| impl ::fidl_next::CompatFrom<crate::Child> for ::fidl_test_protocolrequest::ChildMarker { |
| fn compat_from(_: crate::Child) -> Self { |
| Self |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<::fidl_test_protocolrequest::ChildMarker> for crate::Child { |
| fn compat_from(_: ::fidl_test_protocolrequest::ChildMarker) -> Self { |
| Self |
| } |
| } |
| |
| #[cfg(target_os = "fuchsia")] |
| |
| impl ::fidl_next::ClientCompatFrom<::fidl_test_protocolrequest::ChildProxy> for crate::Child { |
| fn client_compat_from( |
| proxy: ::fidl_test_protocolrequest::ChildProxy, |
| ) -> ::fidl_next::ClientDispatcher<Self, ::fidl_next::fuchsia::zx::Channel> { |
| let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel(); |
| let client_end = ::fidl_next::ClientEnd::from_untyped(channel); |
| ::fidl_next::ClientDispatcher::new(client_end) |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<crate::ParentGetChildResponse> |
| for ::fidl_test_protocolrequest::ParentGetChildResponse |
| { |
| #[inline] |
| fn compat_from(value: crate::ParentGetChildResponse) -> Self { |
| Self { c: ::fidl_next::CompatFrom::compat_from(value.c) } |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<::fidl_test_protocolrequest::ParentGetChildResponse> |
| for crate::ParentGetChildResponse |
| { |
| #[inline] |
| fn compat_from(value: ::fidl_test_protocolrequest::ParentGetChildResponse) -> Self { |
| Self { c: ::fidl_next::CompatFrom::compat_from(value.c) } |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<crate::ParentGetChildRequestResponse> |
| for ::fidl_test_protocolrequest::ParentGetChildRequestResponse |
| { |
| #[inline] |
| fn compat_from(value: crate::ParentGetChildRequestResponse) -> Self { |
| Self { r: ::fidl_next::CompatFrom::compat_from(value.r) } |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<::fidl_test_protocolrequest::ParentGetChildRequestResponse> |
| for crate::ParentGetChildRequestResponse |
| { |
| #[inline] |
| fn compat_from(value: ::fidl_test_protocolrequest::ParentGetChildRequestResponse) -> Self { |
| Self { r: ::fidl_next::CompatFrom::compat_from(value.r) } |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<crate::ParentTakeChildRequest> |
| for ::fidl_test_protocolrequest::ParentTakeChildRequest |
| { |
| #[inline] |
| fn compat_from(value: crate::ParentTakeChildRequest) -> Self { |
| Self { c: ::fidl_next::CompatFrom::compat_from(value.c) } |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<::fidl_test_protocolrequest::ParentTakeChildRequest> |
| for crate::ParentTakeChildRequest |
| { |
| #[inline] |
| fn compat_from(value: ::fidl_test_protocolrequest::ParentTakeChildRequest) -> Self { |
| Self { c: ::fidl_next::CompatFrom::compat_from(value.c) } |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<crate::ParentTakeChildRequestRequest> |
| for ::fidl_test_protocolrequest::ParentTakeChildRequestRequest |
| { |
| #[inline] |
| fn compat_from(value: crate::ParentTakeChildRequestRequest) -> Self { |
| Self { r: ::fidl_next::CompatFrom::compat_from(value.r) } |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<::fidl_test_protocolrequest::ParentTakeChildRequestRequest> |
| for crate::ParentTakeChildRequestRequest |
| { |
| #[inline] |
| fn compat_from(value: ::fidl_test_protocolrequest::ParentTakeChildRequestRequest) -> Self { |
| Self { r: ::fidl_next::CompatFrom::compat_from(value.r) } |
| } |
| } |
| |
| #[cfg(target_os = "fuchsia")] |
| /// An alias for a client over `zx::Channel` for the `Parent` |
| /// protocol. |
| pub type ParentProxy = ::fidl_next::Client<crate::Parent>; |
| |
| impl ::fidl_next::CompatFrom<crate::Parent> for ::fidl_test_protocolrequest::ParentMarker { |
| fn compat_from(_: crate::Parent) -> Self { |
| Self |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<::fidl_test_protocolrequest::ParentMarker> for crate::Parent { |
| fn compat_from(_: ::fidl_test_protocolrequest::ParentMarker) -> Self { |
| Self |
| } |
| } |
| |
| #[cfg(target_os = "fuchsia")] |
| |
| impl ::fidl_next::ClientCompatFrom<::fidl_test_protocolrequest::ParentProxy> for crate::Parent { |
| fn client_compat_from( |
| proxy: ::fidl_test_protocolrequest::ParentProxy, |
| ) -> ::fidl_next::ClientDispatcher<Self, ::fidl_next::fuchsia::zx::Channel> { |
| let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel(); |
| let client_end = ::fidl_next::ClientEnd::from_untyped(channel); |
| ::fidl_next::ClientDispatcher::new(client_end) |
| } |
| } |
| } |