| // DO NOT EDIT: This file is machine-generated by fidlgen |
| #![warn(clippy::all)] |
| #![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)] |
| |
| pub mod natural { |
| |
| #[derive(PartialEq, Clone, Debug)] |
| #[repr(C)] |
| pub struct Empty {} |
| |
| unsafe impl<___E> ::fidl_next::Encode<crate::wire::Empty, ___E> for Empty |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<crate::wire::Empty>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| *out_ = ::core::mem::MaybeUninit::zeroed(); |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Empty, ___E> for &'a Empty |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<crate::wire::Empty>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let crate::wire::Empty { |
| |
| _empty, |
| |
| |
| } = out_; |
| } |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<___E> |
| ::fidl_next::EncodeOption<::fidl_next::WireBox<'static, crate::wire::Empty>, ___E> for Empty |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| Empty: ::fidl_next::Encode<crate::wire::Empty, ___E>, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit<::fidl_next::WireBox<'static, crate::wire::Empty>>, |
| _: (), |
| ) -> ::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(()) |
| } |
| } |
| |
| unsafe impl<'a, ___E> |
| ::fidl_next::EncodeOption<::fidl_next::WireBox<'static, crate::wire::Empty>, ___E> |
| for &'a Empty |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| &'a Empty: ::fidl_next::Encode<crate::wire::Empty, ___E>, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit<::fidl_next::WireBox<'static, crate::wire::Empty>>, |
| _: (), |
| ) -> ::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<crate::wire::Empty> for Empty { |
| const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<crate::wire::Empty, Self> = |
| unsafe { ::fidl_next::CopyOptimization::enable_if(true) }; |
| |
| #[inline] |
| fn from_wire(wire: crate::wire::Empty) -> Self { |
| Self {} |
| } |
| } |
| |
| impl ::fidl_next::FromWireRef<crate::wire::Empty> for Empty { |
| #[inline] |
| fn from_wire_ref(wire: &crate::wire::Empty) -> Self { |
| Self {} |
| } |
| } |
| |
| #[derive(PartialEq, Clone, Debug)] |
| #[repr(C)] |
| pub struct EmptyProtocolSendRequest { |
| pub e: crate::natural::Empty, |
| } |
| |
| unsafe impl<___E> ::fidl_next::Encode<crate::wire::EmptyProtocolSendRequest, ___E> |
| for EmptyProtocolSendRequest |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| { |
| const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization< |
| Self, |
| crate::wire::EmptyProtocolSendRequest, |
| > = unsafe { |
| ::fidl_next::CopyOptimization::enable_if( |
| true |
| |
| && < |
| crate::natural::Empty as ::fidl_next::Encode<crate::wire::Empty, ___E> |
| >::COPY_OPTIMIZATION.is_enabled() |
| |
| ) |
| }; |
| |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<crate::wire::EmptyProtocolSendRequest>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let crate::wire::EmptyProtocolSendRequest { |
| e, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(self.e, encoder_, e, ())?; |
| |
| let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(e.as_mut_ptr()) }; |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::EmptyProtocolSendRequest, ___E> |
| for &'a EmptyProtocolSendRequest |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<crate::wire::EmptyProtocolSendRequest>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let crate::wire::EmptyProtocolSendRequest { |
| |
| e, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(&self.e, encoder_, e, ())?; |
| |
| let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(e.as_mut_ptr()) }; |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<___E> |
| ::fidl_next::EncodeOption< |
| ::fidl_next::WireBox<'static, crate::wire::EmptyProtocolSendRequest>, |
| ___E, |
| > for EmptyProtocolSendRequest |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| EmptyProtocolSendRequest: ::fidl_next::Encode<crate::wire::EmptyProtocolSendRequest, ___E>, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit< |
| ::fidl_next::WireBox<'static, crate::wire::EmptyProtocolSendRequest>, |
| >, |
| _: (), |
| ) -> ::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(()) |
| } |
| } |
| |
| unsafe impl<'a, ___E> |
| ::fidl_next::EncodeOption< |
| ::fidl_next::WireBox<'static, crate::wire::EmptyProtocolSendRequest>, |
| ___E, |
| > for &'a EmptyProtocolSendRequest |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| &'a EmptyProtocolSendRequest: |
| ::fidl_next::Encode<crate::wire::EmptyProtocolSendRequest, ___E>, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit< |
| ::fidl_next::WireBox<'static, crate::wire::EmptyProtocolSendRequest>, |
| >, |
| _: (), |
| ) -> ::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<crate::wire::EmptyProtocolSendRequest> for EmptyProtocolSendRequest { |
| const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization< |
| crate::wire::EmptyProtocolSendRequest, |
| Self, |
| > = unsafe { |
| ::fidl_next::CopyOptimization::enable_if( |
| true |
| |
| && < |
| crate::natural::Empty as ::fidl_next::FromWire<crate::wire::Empty> |
| >::COPY_OPTIMIZATION.is_enabled() |
| |
| ) |
| }; |
| |
| #[inline] |
| fn from_wire(wire: crate::wire::EmptyProtocolSendRequest) -> Self { |
| Self { e: ::fidl_next::FromWire::from_wire(wire.e) } |
| } |
| } |
| |
| impl ::fidl_next::FromWireRef<crate::wire::EmptyProtocolSendRequest> for EmptyProtocolSendRequest { |
| #[inline] |
| fn from_wire_ref(wire: &crate::wire::EmptyProtocolSendRequest) -> Self { |
| Self { e: ::fidl_next::FromWireRef::from_wire_ref(&wire.e) } |
| } |
| } |
| |
| #[derive(PartialEq, Clone, Debug)] |
| #[repr(C)] |
| pub struct EmptyProtocolReceiveRequest { |
| pub e: crate::natural::Empty, |
| } |
| |
| unsafe impl<___E> ::fidl_next::Encode<crate::wire::EmptyProtocolReceiveRequest, ___E> |
| for EmptyProtocolReceiveRequest |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| { |
| const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization< |
| Self, |
| crate::wire::EmptyProtocolReceiveRequest, |
| > = unsafe { |
| ::fidl_next::CopyOptimization::enable_if( |
| true |
| |
| && < |
| crate::natural::Empty as ::fidl_next::Encode<crate::wire::Empty, ___E> |
| >::COPY_OPTIMIZATION.is_enabled() |
| |
| ) |
| }; |
| |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<crate::wire::EmptyProtocolReceiveRequest>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let crate::wire::EmptyProtocolReceiveRequest { |
| e, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(self.e, encoder_, e, ())?; |
| |
| let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(e.as_mut_ptr()) }; |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::EmptyProtocolReceiveRequest, ___E> |
| for &'a EmptyProtocolReceiveRequest |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<crate::wire::EmptyProtocolReceiveRequest>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let crate::wire::EmptyProtocolReceiveRequest { |
| |
| e, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(&self.e, encoder_, e, ())?; |
| |
| let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(e.as_mut_ptr()) }; |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<___E> |
| ::fidl_next::EncodeOption< |
| ::fidl_next::WireBox<'static, crate::wire::EmptyProtocolReceiveRequest>, |
| ___E, |
| > for EmptyProtocolReceiveRequest |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| EmptyProtocolReceiveRequest: |
| ::fidl_next::Encode<crate::wire::EmptyProtocolReceiveRequest, ___E>, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit< |
| ::fidl_next::WireBox<'static, crate::wire::EmptyProtocolReceiveRequest>, |
| >, |
| _: (), |
| ) -> ::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(()) |
| } |
| } |
| |
| unsafe impl<'a, ___E> |
| ::fidl_next::EncodeOption< |
| ::fidl_next::WireBox<'static, crate::wire::EmptyProtocolReceiveRequest>, |
| ___E, |
| > for &'a EmptyProtocolReceiveRequest |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| &'a EmptyProtocolReceiveRequest: |
| ::fidl_next::Encode<crate::wire::EmptyProtocolReceiveRequest, ___E>, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit< |
| ::fidl_next::WireBox<'static, crate::wire::EmptyProtocolReceiveRequest>, |
| >, |
| _: (), |
| ) -> ::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<crate::wire::EmptyProtocolReceiveRequest> |
| for EmptyProtocolReceiveRequest |
| { |
| const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization< |
| crate::wire::EmptyProtocolReceiveRequest, |
| Self, |
| > = unsafe { |
| ::fidl_next::CopyOptimization::enable_if( |
| true |
| |
| && < |
| crate::natural::Empty as ::fidl_next::FromWire<crate::wire::Empty> |
| >::COPY_OPTIMIZATION.is_enabled() |
| |
| ) |
| }; |
| |
| #[inline] |
| fn from_wire(wire: crate::wire::EmptyProtocolReceiveRequest) -> Self { |
| Self { e: ::fidl_next::FromWire::from_wire(wire.e) } |
| } |
| } |
| |
| impl ::fidl_next::FromWireRef<crate::wire::EmptyProtocolReceiveRequest> |
| for EmptyProtocolReceiveRequest |
| { |
| #[inline] |
| fn from_wire_ref(wire: &crate::wire::EmptyProtocolReceiveRequest) -> Self { |
| Self { e: ::fidl_next::FromWireRef::from_wire_ref(&wire.e) } |
| } |
| } |
| |
| #[derive(PartialEq, Clone, Debug)] |
| #[repr(C)] |
| pub struct EmptyProtocolSendAndReceiveRequest { |
| pub e: crate::natural::Empty, |
| } |
| |
| unsafe impl<___E> ::fidl_next::Encode<crate::wire::EmptyProtocolSendAndReceiveRequest, ___E> |
| for EmptyProtocolSendAndReceiveRequest |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| { |
| const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization< |
| Self, |
| crate::wire::EmptyProtocolSendAndReceiveRequest, |
| > = unsafe { |
| ::fidl_next::CopyOptimization::enable_if( |
| true |
| |
| && < |
| crate::natural::Empty as ::fidl_next::Encode<crate::wire::Empty, ___E> |
| >::COPY_OPTIMIZATION.is_enabled() |
| |
| ) |
| }; |
| |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<crate::wire::EmptyProtocolSendAndReceiveRequest>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let crate::wire::EmptyProtocolSendAndReceiveRequest { |
| e, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(self.e, encoder_, e, ())?; |
| |
| let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(e.as_mut_ptr()) }; |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::EmptyProtocolSendAndReceiveRequest, ___E> |
| for &'a EmptyProtocolSendAndReceiveRequest |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<crate::wire::EmptyProtocolSendAndReceiveRequest>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let crate::wire::EmptyProtocolSendAndReceiveRequest { |
| |
| e, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(&self.e, encoder_, e, ())?; |
| |
| let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(e.as_mut_ptr()) }; |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<___E> |
| ::fidl_next::EncodeOption< |
| ::fidl_next::WireBox<'static, crate::wire::EmptyProtocolSendAndReceiveRequest>, |
| ___E, |
| > for EmptyProtocolSendAndReceiveRequest |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| EmptyProtocolSendAndReceiveRequest: |
| ::fidl_next::Encode<crate::wire::EmptyProtocolSendAndReceiveRequest, ___E>, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit< |
| ::fidl_next::WireBox<'static, crate::wire::EmptyProtocolSendAndReceiveRequest>, |
| >, |
| _: (), |
| ) -> ::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(()) |
| } |
| } |
| |
| unsafe impl<'a, ___E> |
| ::fidl_next::EncodeOption< |
| ::fidl_next::WireBox<'static, crate::wire::EmptyProtocolSendAndReceiveRequest>, |
| ___E, |
| > for &'a EmptyProtocolSendAndReceiveRequest |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| &'a EmptyProtocolSendAndReceiveRequest: |
| ::fidl_next::Encode<crate::wire::EmptyProtocolSendAndReceiveRequest, ___E>, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit< |
| ::fidl_next::WireBox<'static, crate::wire::EmptyProtocolSendAndReceiveRequest>, |
| >, |
| _: (), |
| ) -> ::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<crate::wire::EmptyProtocolSendAndReceiveRequest> |
| for EmptyProtocolSendAndReceiveRequest |
| { |
| const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization< |
| crate::wire::EmptyProtocolSendAndReceiveRequest, |
| Self, |
| > = unsafe { |
| ::fidl_next::CopyOptimization::enable_if( |
| true |
| |
| && < |
| crate::natural::Empty as ::fidl_next::FromWire<crate::wire::Empty> |
| >::COPY_OPTIMIZATION.is_enabled() |
| |
| ) |
| }; |
| |
| #[inline] |
| fn from_wire(wire: crate::wire::EmptyProtocolSendAndReceiveRequest) -> Self { |
| Self { e: ::fidl_next::FromWire::from_wire(wire.e) } |
| } |
| } |
| |
| impl ::fidl_next::FromWireRef<crate::wire::EmptyProtocolSendAndReceiveRequest> |
| for EmptyProtocolSendAndReceiveRequest |
| { |
| #[inline] |
| fn from_wire_ref(wire: &crate::wire::EmptyProtocolSendAndReceiveRequest) -> Self { |
| Self { e: ::fidl_next::FromWireRef::from_wire_ref(&wire.e) } |
| } |
| } |
| |
| #[derive(PartialEq, Clone, Debug)] |
| #[repr(C)] |
| pub struct EmptyProtocolSendAndReceiveResponse { |
| pub e: crate::natural::Empty, |
| } |
| |
| unsafe impl<___E> ::fidl_next::Encode<crate::wire::EmptyProtocolSendAndReceiveResponse, ___E> |
| for EmptyProtocolSendAndReceiveResponse |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| { |
| const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization< |
| Self, |
| crate::wire::EmptyProtocolSendAndReceiveResponse, |
| > = unsafe { |
| ::fidl_next::CopyOptimization::enable_if( |
| true |
| |
| && < |
| crate::natural::Empty as ::fidl_next::Encode<crate::wire::Empty, ___E> |
| >::COPY_OPTIMIZATION.is_enabled() |
| |
| ) |
| }; |
| |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<crate::wire::EmptyProtocolSendAndReceiveResponse>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let crate::wire::EmptyProtocolSendAndReceiveResponse { |
| e, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(self.e, encoder_, e, ())?; |
| |
| let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(e.as_mut_ptr()) }; |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<'a, ___E> |
| ::fidl_next::Encode<crate::wire::EmptyProtocolSendAndReceiveResponse, ___E> |
| for &'a EmptyProtocolSendAndReceiveResponse |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<crate::wire::EmptyProtocolSendAndReceiveResponse>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let crate::wire::EmptyProtocolSendAndReceiveResponse { |
| |
| e, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(&self.e, encoder_, e, ())?; |
| |
| let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(e.as_mut_ptr()) }; |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<___E> |
| ::fidl_next::EncodeOption< |
| ::fidl_next::WireBox<'static, crate::wire::EmptyProtocolSendAndReceiveResponse>, |
| ___E, |
| > for EmptyProtocolSendAndReceiveResponse |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| EmptyProtocolSendAndReceiveResponse: |
| ::fidl_next::Encode<crate::wire::EmptyProtocolSendAndReceiveResponse, ___E>, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit< |
| ::fidl_next::WireBox<'static, crate::wire::EmptyProtocolSendAndReceiveResponse>, |
| >, |
| _: (), |
| ) -> ::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(()) |
| } |
| } |
| |
| unsafe impl<'a, ___E> |
| ::fidl_next::EncodeOption< |
| ::fidl_next::WireBox<'static, crate::wire::EmptyProtocolSendAndReceiveResponse>, |
| ___E, |
| > for &'a EmptyProtocolSendAndReceiveResponse |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| &'a EmptyProtocolSendAndReceiveResponse: |
| ::fidl_next::Encode<crate::wire::EmptyProtocolSendAndReceiveResponse, ___E>, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit< |
| ::fidl_next::WireBox<'static, crate::wire::EmptyProtocolSendAndReceiveResponse>, |
| >, |
| _: (), |
| ) -> ::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<crate::wire::EmptyProtocolSendAndReceiveResponse> |
| for EmptyProtocolSendAndReceiveResponse |
| { |
| const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization< |
| crate::wire::EmptyProtocolSendAndReceiveResponse, |
| Self, |
| > = unsafe { |
| ::fidl_next::CopyOptimization::enable_if( |
| true |
| |
| && < |
| crate::natural::Empty as ::fidl_next::FromWire<crate::wire::Empty> |
| >::COPY_OPTIMIZATION.is_enabled() |
| |
| ) |
| }; |
| |
| #[inline] |
| fn from_wire(wire: crate::wire::EmptyProtocolSendAndReceiveResponse) -> Self { |
| Self { e: ::fidl_next::FromWire::from_wire(wire.e) } |
| } |
| } |
| |
| impl ::fidl_next::FromWireRef<crate::wire::EmptyProtocolSendAndReceiveResponse> |
| for EmptyProtocolSendAndReceiveResponse |
| { |
| #[inline] |
| fn from_wire_ref(wire: &crate::wire::EmptyProtocolSendAndReceiveResponse) -> Self { |
| Self { e: ::fidl_next::FromWireRef::from_wire_ref(&wire.e) } |
| } |
| } |
| } |
| |
| pub mod wire { |
| |
| /// The wire type corresponding to [`Empty`]. |
| #[derive(Clone, Debug)] |
| #[repr(C)] |
| pub struct Empty { |
| pub(crate) _empty: fidl_next::WireEmptyStructPlaceholder, |
| } |
| |
| static_assertions::const_assert_eq!(std::mem::size_of::<Empty>(), 1); |
| static_assertions::const_assert_eq!(std::mem::align_of::<Empty>(), 1); |
| |
| unsafe impl ::fidl_next::Wire for Empty { |
| type Owned<'de> = Empty; |
| |
| #[inline] |
| fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) { |
| ::fidl_next::munge! { |
| let Self { |
| |
| _empty, |
| |
| |
| } = &mut *out_; |
| } |
| } |
| } |
| |
| unsafe impl<___D> ::fidl_next::Decode<___D> for Empty |
| where |
| ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized, |
| { |
| fn decode( |
| slot_: ::fidl_next::Slot<'_, Self>, |
| decoder_: &mut ___D, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::DecodeError> { |
| ::fidl_next::munge! { |
| let Self { |
| |
| mut _empty, |
| |
| |
| } = slot_; |
| } |
| |
| if _empty.as_bytes() != &[0u8] { |
| return Err(::fidl_next::DecodeError::InvalidEmptyStruct); |
| } |
| |
| Ok(()) |
| } |
| } |
| |
| impl ::fidl_next::IntoNatural for Empty { |
| type Natural = crate::natural::Empty; |
| } |
| |
| impl ::fidl_next::Unconstrained for Empty {} |
| |
| /// The wire type corresponding to [`EmptyProtocolSendRequest`]. |
| #[derive(Clone, Debug)] |
| #[repr(C)] |
| pub struct EmptyProtocolSendRequest { |
| pub e: crate::wire::Empty, |
| } |
| |
| static_assertions::const_assert_eq!(std::mem::size_of::<EmptyProtocolSendRequest>(), 1); |
| static_assertions::const_assert_eq!(std::mem::align_of::<EmptyProtocolSendRequest>(), 1); |
| |
| static_assertions::const_assert_eq!(std::mem::offset_of!(EmptyProtocolSendRequest, e), 0); |
| |
| unsafe impl ::fidl_next::Wire for EmptyProtocolSendRequest { |
| type Owned<'de> = EmptyProtocolSendRequest; |
| |
| #[inline] |
| fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) { |
| ::fidl_next::munge! { |
| let Self { |
| |
| e, |
| |
| } = &mut *out_; |
| } |
| |
| ::fidl_next::Wire::zero_padding(e); |
| } |
| } |
| |
| unsafe impl<___D> ::fidl_next::Decode<___D> for EmptyProtocolSendRequest |
| where |
| ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized, |
| { |
| fn decode( |
| slot_: ::fidl_next::Slot<'_, Self>, |
| decoder_: &mut ___D, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::DecodeError> { |
| ::fidl_next::munge! { |
| let Self { |
| |
| mut e, |
| |
| } = slot_; |
| } |
| |
| let _field = e.as_mut(); |
| |
| ::fidl_next::Decode::decode(e.as_mut(), decoder_, ())?; |
| |
| Ok(()) |
| } |
| } |
| |
| impl ::fidl_next::IntoNatural for EmptyProtocolSendRequest { |
| type Natural = crate::natural::EmptyProtocolSendRequest; |
| } |
| |
| impl ::fidl_next::Unconstrained for EmptyProtocolSendRequest {} |
| |
| /// The wire type corresponding to [`EmptyProtocolReceiveRequest`]. |
| #[derive(Clone, Debug)] |
| #[repr(C)] |
| pub struct EmptyProtocolReceiveRequest { |
| pub e: crate::wire::Empty, |
| } |
| |
| static_assertions::const_assert_eq!(std::mem::size_of::<EmptyProtocolReceiveRequest>(), 1); |
| static_assertions::const_assert_eq!(std::mem::align_of::<EmptyProtocolReceiveRequest>(), 1); |
| |
| static_assertions::const_assert_eq!(std::mem::offset_of!(EmptyProtocolReceiveRequest, e), 0); |
| |
| unsafe impl ::fidl_next::Wire for EmptyProtocolReceiveRequest { |
| type Owned<'de> = EmptyProtocolReceiveRequest; |
| |
| #[inline] |
| fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) { |
| ::fidl_next::munge! { |
| let Self { |
| |
| e, |
| |
| } = &mut *out_; |
| } |
| |
| ::fidl_next::Wire::zero_padding(e); |
| } |
| } |
| |
| unsafe impl<___D> ::fidl_next::Decode<___D> for EmptyProtocolReceiveRequest |
| where |
| ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized, |
| { |
| fn decode( |
| slot_: ::fidl_next::Slot<'_, Self>, |
| decoder_: &mut ___D, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::DecodeError> { |
| ::fidl_next::munge! { |
| let Self { |
| |
| mut e, |
| |
| } = slot_; |
| } |
| |
| let _field = e.as_mut(); |
| |
| ::fidl_next::Decode::decode(e.as_mut(), decoder_, ())?; |
| |
| Ok(()) |
| } |
| } |
| |
| impl ::fidl_next::IntoNatural for EmptyProtocolReceiveRequest { |
| type Natural = crate::natural::EmptyProtocolReceiveRequest; |
| } |
| |
| impl ::fidl_next::Unconstrained for EmptyProtocolReceiveRequest {} |
| |
| /// The wire type corresponding to [`EmptyProtocolSendAndReceiveRequest`]. |
| #[derive(Clone, Debug)] |
| #[repr(C)] |
| pub struct EmptyProtocolSendAndReceiveRequest { |
| pub e: crate::wire::Empty, |
| } |
| |
| static_assertions::const_assert_eq!( |
| std::mem::size_of::<EmptyProtocolSendAndReceiveRequest>(), |
| 1 |
| ); |
| static_assertions::const_assert_eq!( |
| std::mem::align_of::<EmptyProtocolSendAndReceiveRequest>(), |
| 1 |
| ); |
| |
| static_assertions::const_assert_eq!( |
| std::mem::offset_of!(EmptyProtocolSendAndReceiveRequest, e), |
| 0 |
| ); |
| |
| unsafe impl ::fidl_next::Wire for EmptyProtocolSendAndReceiveRequest { |
| type Owned<'de> = EmptyProtocolSendAndReceiveRequest; |
| |
| #[inline] |
| fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) { |
| ::fidl_next::munge! { |
| let Self { |
| |
| e, |
| |
| } = &mut *out_; |
| } |
| |
| ::fidl_next::Wire::zero_padding(e); |
| } |
| } |
| |
| unsafe impl<___D> ::fidl_next::Decode<___D> for EmptyProtocolSendAndReceiveRequest |
| where |
| ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized, |
| { |
| fn decode( |
| slot_: ::fidl_next::Slot<'_, Self>, |
| decoder_: &mut ___D, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::DecodeError> { |
| ::fidl_next::munge! { |
| let Self { |
| |
| mut e, |
| |
| } = slot_; |
| } |
| |
| let _field = e.as_mut(); |
| |
| ::fidl_next::Decode::decode(e.as_mut(), decoder_, ())?; |
| |
| Ok(()) |
| } |
| } |
| |
| impl ::fidl_next::IntoNatural for EmptyProtocolSendAndReceiveRequest { |
| type Natural = crate::natural::EmptyProtocolSendAndReceiveRequest; |
| } |
| |
| impl ::fidl_next::Unconstrained for EmptyProtocolSendAndReceiveRequest {} |
| |
| /// The wire type corresponding to [`EmptyProtocolSendAndReceiveResponse`]. |
| #[derive(Clone, Debug)] |
| #[repr(C)] |
| pub struct EmptyProtocolSendAndReceiveResponse { |
| pub e: crate::wire::Empty, |
| } |
| |
| static_assertions::const_assert_eq!( |
| std::mem::size_of::<EmptyProtocolSendAndReceiveResponse>(), |
| 1 |
| ); |
| static_assertions::const_assert_eq!( |
| std::mem::align_of::<EmptyProtocolSendAndReceiveResponse>(), |
| 1 |
| ); |
| |
| static_assertions::const_assert_eq!( |
| std::mem::offset_of!(EmptyProtocolSendAndReceiveResponse, e), |
| 0 |
| ); |
| |
| unsafe impl ::fidl_next::Wire for EmptyProtocolSendAndReceiveResponse { |
| type Owned<'de> = EmptyProtocolSendAndReceiveResponse; |
| |
| #[inline] |
| fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) { |
| ::fidl_next::munge! { |
| let Self { |
| |
| e, |
| |
| } = &mut *out_; |
| } |
| |
| ::fidl_next::Wire::zero_padding(e); |
| } |
| } |
| |
| unsafe impl<___D> ::fidl_next::Decode<___D> for EmptyProtocolSendAndReceiveResponse |
| where |
| ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized, |
| { |
| fn decode( |
| slot_: ::fidl_next::Slot<'_, Self>, |
| decoder_: &mut ___D, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::DecodeError> { |
| ::fidl_next::munge! { |
| let Self { |
| |
| mut e, |
| |
| } = slot_; |
| } |
| |
| let _field = e.as_mut(); |
| |
| ::fidl_next::Decode::decode(e.as_mut(), decoder_, ())?; |
| |
| Ok(()) |
| } |
| } |
| |
| impl ::fidl_next::IntoNatural for EmptyProtocolSendAndReceiveResponse { |
| type Natural = crate::natural::EmptyProtocolSendAndReceiveResponse; |
| } |
| |
| impl ::fidl_next::Unconstrained for EmptyProtocolSendAndReceiveResponse {} |
| } |
| |
| pub mod wire_optional {} |
| |
| pub mod generic { |
| |
| pub struct Empty {} |
| |
| unsafe impl<___E> ::fidl_next::Encode<crate::wire::Empty, ___E> for Empty |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<crate::wire::Empty>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let crate::wire::Empty { |
| |
| _empty, |
| |
| |
| } = out_; |
| } |
| |
| Ok(()) |
| } |
| } |
| |
| pub struct EmptyProtocolSendRequest<T0> { |
| pub e: T0, |
| } |
| |
| unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::EmptyProtocolSendRequest, ___E> |
| for EmptyProtocolSendRequest<T0> |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| T0: ::fidl_next::Encode<crate::wire::Empty, ___E>, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<crate::wire::EmptyProtocolSendRequest>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let crate::wire::EmptyProtocolSendRequest { |
| |
| e, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(self.e, encoder_, e, ())?; |
| |
| Ok(()) |
| } |
| } |
| |
| pub struct EmptyProtocolReceiveRequest<T0> { |
| pub e: T0, |
| } |
| |
| unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::EmptyProtocolReceiveRequest, ___E> |
| for EmptyProtocolReceiveRequest<T0> |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| T0: ::fidl_next::Encode<crate::wire::Empty, ___E>, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<crate::wire::EmptyProtocolReceiveRequest>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let crate::wire::EmptyProtocolReceiveRequest { |
| |
| e, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(self.e, encoder_, e, ())?; |
| |
| Ok(()) |
| } |
| } |
| |
| pub struct EmptyProtocolSendAndReceiveRequest<T0> { |
| pub e: T0, |
| } |
| |
| unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::EmptyProtocolSendAndReceiveRequest, ___E> |
| for EmptyProtocolSendAndReceiveRequest<T0> |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| T0: ::fidl_next::Encode<crate::wire::Empty, ___E>, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<crate::wire::EmptyProtocolSendAndReceiveRequest>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let crate::wire::EmptyProtocolSendAndReceiveRequest { |
| |
| e, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(self.e, encoder_, e, ())?; |
| |
| Ok(()) |
| } |
| } |
| |
| pub struct EmptyProtocolSendAndReceiveResponse<T0> { |
| pub e: T0, |
| } |
| |
| unsafe impl<___E, T0> |
| ::fidl_next::Encode<crate::wire::EmptyProtocolSendAndReceiveResponse, ___E> |
| for EmptyProtocolSendAndReceiveResponse<T0> |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| T0: ::fidl_next::Encode<crate::wire::Empty, ___E>, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<crate::wire::EmptyProtocolSendAndReceiveResponse>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let crate::wire::EmptyProtocolSendAndReceiveResponse { |
| |
| e, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(self.e, encoder_, e, ())?; |
| |
| Ok(()) |
| } |
| } |
| } |
| |
| pub use self::natural::*; |
| |
| /// The type corresponding to the EmptyProtocol protocol. |
| #[derive(PartialEq, Debug)] |
| pub struct EmptyProtocol; |
| |
| #[cfg(target_os = "fuchsia")] |
| impl ::fidl_next::HasTransport for EmptyProtocol { |
| type Transport = ::fidl_next::fuchsia::zx::Channel; |
| } |
| |
| pub mod empty_protocol { |
| pub mod prelude { |
| pub use crate::{ |
| EmptyProtocol, EmptyProtocolClientHandler, EmptyProtocolServerHandler, empty_protocol, |
| }; |
| |
| pub use crate::natural::EmptyProtocolReceiveRequest; |
| |
| pub use crate::natural::EmptyProtocolSendAndReceiveRequest; |
| |
| pub use crate::natural::EmptyProtocolSendAndReceiveResponse; |
| |
| pub use crate::natural::EmptyProtocolSendRequest; |
| } |
| |
| pub struct Send; |
| |
| impl ::fidl_next::Method for Send { |
| const ORDINAL: u64 = 1378773277029173000; |
| const FLEXIBILITY: ::fidl_next::protocol::Flexibility = |
| ::fidl_next::protocol::Flexibility::Strict; |
| |
| type Protocol = crate::EmptyProtocol; |
| |
| type Request = crate::wire::EmptyProtocolSendRequest; |
| } |
| |
| pub struct Receive; |
| |
| impl ::fidl_next::Method for Receive { |
| const ORDINAL: u64 = 2301564782476583487; |
| const FLEXIBILITY: ::fidl_next::protocol::Flexibility = |
| ::fidl_next::protocol::Flexibility::Strict; |
| |
| type Protocol = crate::EmptyProtocol; |
| |
| type Request = crate::wire::EmptyProtocolReceiveRequest; |
| } |
| |
| pub struct SendAndReceive; |
| |
| impl ::fidl_next::Method for SendAndReceive { |
| const ORDINAL: u64 = 534401212734647530; |
| const FLEXIBILITY: ::fidl_next::protocol::Flexibility = |
| ::fidl_next::protocol::Flexibility::Strict; |
| |
| type Protocol = crate::EmptyProtocol; |
| |
| type Request = crate::wire::EmptyProtocolSendAndReceiveRequest; |
| } |
| |
| impl ::fidl_next::TwoWayMethod for SendAndReceive { |
| type Response = crate::wire::EmptyProtocolSendAndReceiveResponse; |
| } |
| |
| impl<___R> ::fidl_next::Respond<___R> for SendAndReceive { |
| type Output = crate::generic::EmptyProtocolSendAndReceiveResponse<___R>; |
| |
| fn respond(response: ___R) -> Self::Output { |
| crate::generic::EmptyProtocolSendAndReceiveResponse { e: response } |
| } |
| } |
| |
| mod ___detail { |
| unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::EmptyProtocol |
| where |
| ___T: ::fidl_next::Transport, |
| { |
| type Client = EmptyProtocolClient<___T>; |
| type Server = EmptyProtocolServer<___T>; |
| } |
| |
| /// The client for the `EmptyProtocol` protocol. |
| #[repr(transparent)] |
| pub struct EmptyProtocolClient<___T: ::fidl_next::Transport> { |
| #[allow(dead_code)] |
| client: ::fidl_next::protocol::Client<___T>, |
| } |
| |
| impl<___T> EmptyProtocolClient<___T> |
| where |
| ___T: ::fidl_next::Transport, |
| { |
| pub fn send( |
| &self, |
| |
| e: impl ::fidl_next::Encode< |
| crate::wire::Empty, |
| <___T as ::fidl_next::Transport>::SendBuffer, |
| >, |
| ) -> ::fidl_next::SendFuture<'_, ___T> |
| where |
| <___T as ::fidl_next::Transport>::SendBuffer: |
| ::fidl_next::encoder::InternalHandleEncoder, |
| { |
| self.send_with(crate::generic::EmptyProtocolSendRequest { e }) |
| } |
| |
| pub fn send_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T> |
| where |
| ___R: ::fidl_next::Encode< |
| crate::wire::EmptyProtocolSendRequest, |
| <___T as ::fidl_next::Transport>::SendBuffer, |
| >, |
| { |
| ::fidl_next::SendFuture::from_untyped(self.client.send_one_way( |
| 1378773277029173000, |
| <super::Send as ::fidl_next::Method>::FLEXIBILITY, |
| request, |
| )) |
| } |
| |
| pub fn send_and_receive( |
| &self, |
| |
| e: impl ::fidl_next::Encode< |
| crate::wire::Empty, |
| <___T as ::fidl_next::Transport>::SendBuffer, |
| >, |
| ) -> ::fidl_next::TwoWayFuture<'_, super::SendAndReceive, ___T> |
| where |
| <___T as ::fidl_next::Transport>::SendBuffer: |
| ::fidl_next::encoder::InternalHandleEncoder, |
| { |
| self.send_and_receive_with(crate::generic::EmptyProtocolSendAndReceiveRequest { e }) |
| } |
| |
| pub fn send_and_receive_with<___R>( |
| &self, |
| request: ___R, |
| ) -> ::fidl_next::TwoWayFuture<'_, super::SendAndReceive, ___T> |
| where |
| ___R: ::fidl_next::Encode< |
| crate::wire::EmptyProtocolSendAndReceiveRequest, |
| <___T as ::fidl_next::Transport>::SendBuffer, |
| >, |
| { |
| ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way( |
| 534401212734647530, |
| <super::SendAndReceive as ::fidl_next::Method>::FLEXIBILITY, |
| request, |
| )) |
| } |
| } |
| |
| /// The server for the `EmptyProtocol` protocol. |
| #[repr(transparent)] |
| pub struct EmptyProtocolServer<___T: ::fidl_next::Transport> { |
| server: ::fidl_next::protocol::Server<___T>, |
| } |
| |
| impl<___T> EmptyProtocolServer<___T> |
| where |
| ___T: ::fidl_next::Transport, |
| { |
| pub fn receive( |
| &self, |
| |
| e: impl ::fidl_next::Encode< |
| crate::wire::Empty, |
| <___T as ::fidl_next::Transport>::SendBuffer, |
| >, |
| ) -> ::fidl_next::SendFuture<'_, ___T> |
| where |
| <___T as ::fidl_next::Transport>::SendBuffer: |
| ::fidl_next::encoder::InternalHandleEncoder, |
| { |
| self.receive_with(crate::generic::EmptyProtocolReceiveRequest { e }) |
| } |
| |
| pub fn receive_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T> |
| where |
| ___R: ::fidl_next::Encode< |
| <super::Receive as ::fidl_next::Method>::Request, |
| <___T as ::fidl_next::Transport>::SendBuffer, |
| >, |
| { |
| ::fidl_next::SendFuture::from_untyped(self.server.send_event( |
| 2301564782476583487, |
| <super::Receive as ::fidl_next::Method>::FLEXIBILITY, |
| request, |
| )) |
| } |
| } |
| } |
| } |
| |
| /// A client handler for the EmptyProtocol protocol. |
| /// |
| /// See [`EmptyProtocol`] for more details. |
| pub trait EmptyProtocolClientHandler< |
| #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel, |
| #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport, |
| > |
| { |
| fn receive( |
| &mut self, |
| |
| request: ::fidl_next::Request<empty_protocol::Receive, ___T>, |
| ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send; |
| } |
| |
| impl<___T> EmptyProtocolClientHandler<___T> for ::fidl_next::IgnoreEvents |
| where |
| ___T: ::fidl_next::Transport, |
| { |
| async fn receive(&mut self, _: ::fidl_next::Request<empty_protocol::Receive, ___T>) {} |
| } |
| |
| impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for EmptyProtocol |
| where |
| ___H: EmptyProtocolClientHandler<___T> + ::core::marker::Send, |
| ___T: ::fidl_next::Transport, |
| <empty_protocol::Receive as ::fidl_next::Method>::Request: |
| ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>, |
| { |
| async fn on_event( |
| handler: &mut ___H, |
| ordinal: u64, |
| flexibility: ::fidl_next::protocol::Flexibility, |
| buffer: ___T::RecvBuffer, |
| ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> { |
| match ordinal { |
| 2301564782476583487 => match ::fidl_next::DecoderExt::decode(buffer) { |
| Ok(decoded) => { |
| handler.receive(::fidl_next::Request::from_decoded(decoded)).await; |
| Ok(()) |
| } |
| Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage { |
| ordinal: 2301564782476583487, |
| error, |
| }), |
| }, |
| |
| ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)), |
| } |
| } |
| } |
| |
| /// A server handler for the EmptyProtocol protocol. |
| /// |
| /// See [`EmptyProtocol`] for more details. |
| pub trait EmptyProtocolServerHandler< |
| #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel, |
| #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport, |
| > |
| { |
| fn send( |
| &mut self, |
| |
| request: ::fidl_next::Request<empty_protocol::Send, ___T>, |
| ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send; |
| |
| fn send_and_receive( |
| &mut self, |
| |
| request: ::fidl_next::Request<empty_protocol::SendAndReceive, ___T>, |
| |
| responder: ::fidl_next::Responder<empty_protocol::SendAndReceive, ___T>, |
| ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send; |
| } |
| |
| impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for EmptyProtocol |
| where |
| ___H: EmptyProtocolServerHandler<___T> + ::core::marker::Send, |
| ___T: ::fidl_next::Transport, |
| <empty_protocol::Send as ::fidl_next::Method>::Request: |
| ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>, |
| <empty_protocol::SendAndReceive as ::fidl_next::Method>::Request: |
| ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>, |
| { |
| async fn on_one_way( |
| handler: &mut ___H, |
| ordinal: u64, |
| flexibility: ::fidl_next::protocol::Flexibility, |
| buffer: ___T::RecvBuffer, |
| ) -> ::core::result::Result< |
| (), |
| ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>, |
| > { |
| match ordinal { |
| 1378773277029173000 => match ::fidl_next::DecoderExt::decode(buffer) { |
| Ok(decoded) => { |
| handler.send(::fidl_next::Request::from_decoded(decoded)).await; |
| Ok(()) |
| } |
| Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage { |
| ordinal: 1378773277029173000, |
| error, |
| }), |
| }, |
| |
| ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)), |
| } |
| } |
| |
| async fn on_two_way( |
| handler: &mut ___H, |
| ordinal: u64, |
| flexibility: ::fidl_next::protocol::Flexibility, |
| buffer: ___T::RecvBuffer, |
| responder: ::fidl_next::protocol::Responder<___T>, |
| ) -> ::core::result::Result< |
| (), |
| ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>, |
| > { |
| match ordinal { |
| 534401212734647530 => { |
| let responder = ::fidl_next::Responder::from_untyped(responder); |
| |
| match ::fidl_next::DecoderExt::decode(buffer) { |
| Ok(decoded) => { |
| handler |
| .send_and_receive( |
| ::fidl_next::Request::from_decoded(decoded), |
| responder, |
| ) |
| .await; |
| Ok(()) |
| } |
| Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage { |
| ordinal: 534401212734647530, |
| error, |
| }), |
| } |
| } |
| |
| ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)), |
| } |
| } |
| } |
| |
| /// Compatibility shims which mimic some API surfaces of the current Rust bindings. |
| pub mod compat { |
| |
| impl ::fidl_next::CompatFrom<crate::Empty> for ::fidl_test_emptystruct::Empty { |
| #[inline] |
| fn compat_from(value: crate::Empty) -> Self { |
| Self {} |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<::fidl_test_emptystruct::Empty> for crate::Empty { |
| #[inline] |
| fn compat_from(value: ::fidl_test_emptystruct::Empty) -> Self { |
| Self {} |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<crate::EmptyProtocolSendRequest> |
| for ::fidl_test_emptystruct::EmptyProtocolSendRequest |
| { |
| #[inline] |
| fn compat_from(value: crate::EmptyProtocolSendRequest) -> Self { |
| Self { e: ::fidl_next::CompatFrom::compat_from(value.e) } |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<::fidl_test_emptystruct::EmptyProtocolSendRequest> |
| for crate::EmptyProtocolSendRequest |
| { |
| #[inline] |
| fn compat_from(value: ::fidl_test_emptystruct::EmptyProtocolSendRequest) -> Self { |
| Self { e: ::fidl_next::CompatFrom::compat_from(value.e) } |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<crate::EmptyProtocolReceiveRequest> |
| for ::fidl_test_emptystruct::EmptyProtocolReceiveRequest |
| { |
| #[inline] |
| fn compat_from(value: crate::EmptyProtocolReceiveRequest) -> Self { |
| Self { e: ::fidl_next::CompatFrom::compat_from(value.e) } |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<::fidl_test_emptystruct::EmptyProtocolReceiveRequest> |
| for crate::EmptyProtocolReceiveRequest |
| { |
| #[inline] |
| fn compat_from(value: ::fidl_test_emptystruct::EmptyProtocolReceiveRequest) -> Self { |
| Self { e: ::fidl_next::CompatFrom::compat_from(value.e) } |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<crate::EmptyProtocolSendAndReceiveRequest> |
| for ::fidl_test_emptystruct::EmptyProtocolSendAndReceiveRequest |
| { |
| #[inline] |
| fn compat_from(value: crate::EmptyProtocolSendAndReceiveRequest) -> Self { |
| Self { e: ::fidl_next::CompatFrom::compat_from(value.e) } |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<::fidl_test_emptystruct::EmptyProtocolSendAndReceiveRequest> |
| for crate::EmptyProtocolSendAndReceiveRequest |
| { |
| #[inline] |
| fn compat_from(value: ::fidl_test_emptystruct::EmptyProtocolSendAndReceiveRequest) -> Self { |
| Self { e: ::fidl_next::CompatFrom::compat_from(value.e) } |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<crate::EmptyProtocolSendAndReceiveResponse> |
| for ::fidl_test_emptystruct::EmptyProtocolSendAndReceiveResponse |
| { |
| #[inline] |
| fn compat_from(value: crate::EmptyProtocolSendAndReceiveResponse) -> Self { |
| Self { e: ::fidl_next::CompatFrom::compat_from(value.e) } |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<::fidl_test_emptystruct::EmptyProtocolSendAndReceiveResponse> |
| for crate::EmptyProtocolSendAndReceiveResponse |
| { |
| #[inline] |
| fn compat_from( |
| value: ::fidl_test_emptystruct::EmptyProtocolSendAndReceiveResponse, |
| ) -> Self { |
| Self { e: ::fidl_next::CompatFrom::compat_from(value.e) } |
| } |
| } |
| |
| #[cfg(target_os = "fuchsia")] |
| /// An alias for a client over `zx::Channel` for the `EmptyProtocol` |
| /// protocol. |
| pub type EmptyProtocolProxy = ::fidl_next::Client<crate::EmptyProtocol>; |
| |
| impl ::fidl_next::CompatFrom<crate::EmptyProtocol> |
| for ::fidl_test_emptystruct::EmptyProtocolMarker |
| { |
| fn compat_from(_: crate::EmptyProtocol) -> Self { |
| Self |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<::fidl_test_emptystruct::EmptyProtocolMarker> |
| for crate::EmptyProtocol |
| { |
| fn compat_from(_: ::fidl_test_emptystruct::EmptyProtocolMarker) -> Self { |
| Self |
| } |
| } |
| |
| #[cfg(target_os = "fuchsia")] |
| |
| impl ::fidl_next::ClientCompatFrom<::fidl_test_emptystruct::EmptyProtocolProxy> |
| for crate::EmptyProtocol |
| { |
| fn client_compat_from( |
| proxy: ::fidl_test_emptystruct::EmptyProtocolProxy, |
| ) -> ::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) |
| } |
| } |
| } |