| // 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 ByteAndBytes { |
| pub single_byte: u8, |
| } |
| |
| unsafe impl<___E> ::fidl_next::Encode<crate::wire::ByteAndBytes, ___E> for ByteAndBytes |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| { |
| const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, crate::wire::ByteAndBytes> = unsafe { |
| ::fidl_next::CopyOptimization::enable_if( |
| true && <u8 as ::fidl_next::Encode<u8, ___E>>::COPY_OPTIMIZATION.is_enabled(), |
| ) |
| }; |
| |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<crate::wire::ByteAndBytes>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let crate::wire::ByteAndBytes { |
| single_byte, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(self.single_byte, encoder_, single_byte, ())?; |
| |
| let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(single_byte.as_mut_ptr()) }; |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ByteAndBytes, ___E> for &'a ByteAndBytes |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<crate::wire::ByteAndBytes>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let crate::wire::ByteAndBytes { |
| |
| single_byte, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(&self.single_byte, encoder_, single_byte, ())?; |
| |
| let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(single_byte.as_mut_ptr()) }; |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<___E> |
| ::fidl_next::EncodeOption<::fidl_next::WireBox<'static, crate::wire::ByteAndBytes>, ___E> |
| for ByteAndBytes |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| ByteAndBytes: ::fidl_next::Encode<crate::wire::ByteAndBytes, ___E>, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit< |
| ::fidl_next::WireBox<'static, crate::wire::ByteAndBytes>, |
| >, |
| _: (), |
| ) -> ::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::ByteAndBytes>, ___E> |
| for &'a ByteAndBytes |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| &'a ByteAndBytes: ::fidl_next::Encode<crate::wire::ByteAndBytes, ___E>, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit< |
| ::fidl_next::WireBox<'static, crate::wire::ByteAndBytes>, |
| >, |
| _: (), |
| ) -> ::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::ByteAndBytes> for ByteAndBytes { |
| const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<crate::wire::ByteAndBytes, Self> = unsafe { |
| ::fidl_next::CopyOptimization::enable_if( |
| true && <u8 as ::fidl_next::FromWire<u8>>::COPY_OPTIMIZATION.is_enabled(), |
| ) |
| }; |
| |
| #[inline] |
| fn from_wire(wire: crate::wire::ByteAndBytes) -> Self { |
| Self { single_byte: ::fidl_next::FromWire::from_wire(wire.single_byte) } |
| } |
| } |
| |
| impl ::fidl_next::FromWireRef<crate::wire::ByteAndBytes> for ByteAndBytes { |
| #[inline] |
| fn from_wire_ref(wire: &crate::wire::ByteAndBytes) -> Self { |
| Self { single_byte: ::fidl_next::FromWireRef::from_wire_ref(&wire.single_byte) } |
| } |
| } |
| } |
| |
| pub mod wire { |
| |
| /// The wire type corresponding to [`ByteAndBytes`]. |
| #[derive(Clone, Debug)] |
| #[repr(C)] |
| pub struct ByteAndBytes { |
| pub single_byte: u8, |
| } |
| |
| static_assertions::const_assert_eq!(std::mem::size_of::<ByteAndBytes>(), 1); |
| static_assertions::const_assert_eq!(std::mem::align_of::<ByteAndBytes>(), 1); |
| |
| static_assertions::const_assert_eq!(std::mem::offset_of!(ByteAndBytes, single_byte), 0); |
| |
| unsafe impl ::fidl_next::Wire for ByteAndBytes { |
| type Decoded<'de> = ByteAndBytes; |
| |
| #[inline] |
| fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) { |
| ::fidl_next::munge! { |
| let Self { |
| |
| single_byte, |
| |
| } = &mut *out_; |
| } |
| |
| ::fidl_next::Wire::zero_padding(single_byte); |
| } |
| } |
| |
| unsafe impl<___D> ::fidl_next::Decode<___D> for ByteAndBytes |
| 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 single_byte, |
| |
| } = slot_; |
| } |
| |
| let _field = single_byte.as_mut(); |
| |
| ::fidl_next::Decode::decode(single_byte.as_mut(), decoder_, ())?; |
| |
| Ok(()) |
| } |
| } |
| |
| impl ::fidl_next::IntoNatural for ByteAndBytes { |
| type Natural = crate::natural::ByteAndBytes; |
| } |
| |
| impl ::fidl_next::Unconstrained for ByteAndBytes {} |
| } |
| |
| pub mod wire_optional {} |
| |
| pub mod generic { |
| |
| pub struct ByteAndBytes<T0> { |
| pub single_byte: T0, |
| } |
| |
| unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::ByteAndBytes, ___E> for ByteAndBytes<T0> |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| T0: ::fidl_next::Encode<u8, ___E>, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<crate::wire::ByteAndBytes>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let crate::wire::ByteAndBytes { |
| |
| single_byte, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(self.single_byte, encoder_, single_byte, ())?; |
| |
| Ok(()) |
| } |
| } |
| } |
| |
| pub use self::natural::*; |
| |
| /// Compatibility shims which mimic some API surfaces of the current Rust bindings. |
| pub mod compat { |
| |
| impl ::fidl_next::CompatFrom<crate::ByteAndBytes> for ::fidl_test_byteandbytes::ByteAndBytes { |
| #[inline] |
| fn compat_from(value: crate::ByteAndBytes) -> Self { |
| Self { single_byte: ::fidl_next::CompatFrom::compat_from(value.single_byte) } |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<::fidl_test_byteandbytes::ByteAndBytes> for crate::ByteAndBytes { |
| #[inline] |
| fn compat_from(value: ::fidl_test_byteandbytes::ByteAndBytes) -> Self { |
| Self { single_byte: ::fidl_next::CompatFrom::compat_from(value.single_byte) } |
| } |
| } |
| } |