| // 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)] |
| pub struct Int16Int8 { |
| pub a: i16, |
| |
| pub b: i8, |
| } |
| |
| unsafe impl<___E> ::fidl_next::Encode<crate::wire::Int16Int8, ___E> for Int16Int8 |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<crate::wire::Int16Int8>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let crate::wire::Int16Int8 { |
| a, |
| b, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(self.a, encoder_, a, ())?; |
| |
| let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(a.as_mut_ptr()) }; |
| |
| ::fidl_next::Encode::encode(self.b, encoder_, b, ())?; |
| |
| let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(b.as_mut_ptr()) }; |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Int16Int8, ___E> for &'a Int16Int8 |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<crate::wire::Int16Int8>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let crate::wire::Int16Int8 { |
| |
| a, |
| b, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(&self.a, encoder_, a, ())?; |
| |
| let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(a.as_mut_ptr()) }; |
| |
| ::fidl_next::Encode::encode(&self.b, encoder_, b, ())?; |
| |
| let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(b.as_mut_ptr()) }; |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<___E> |
| ::fidl_next::EncodeOption<::fidl_next::WireBox<'static, crate::wire::Int16Int8>, ___E> |
| for Int16Int8 |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| Int16Int8: ::fidl_next::Encode<crate::wire::Int16Int8, ___E>, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit< |
| ::fidl_next::WireBox<'static, crate::wire::Int16Int8>, |
| >, |
| _: (), |
| ) -> ::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::Int16Int8>, ___E> |
| for &'a Int16Int8 |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| &'a Int16Int8: ::fidl_next::Encode<crate::wire::Int16Int8, ___E>, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit< |
| ::fidl_next::WireBox<'static, crate::wire::Int16Int8>, |
| >, |
| _: (), |
| ) -> ::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::Int16Int8> for Int16Int8 { |
| #[inline] |
| fn from_wire(wire: crate::wire::Int16Int8) -> Self { |
| Self { |
| a: ::fidl_next::FromWire::from_wire(wire.a), |
| |
| b: ::fidl_next::FromWire::from_wire(wire.b), |
| } |
| } |
| } |
| |
| impl ::fidl_next::FromWireRef<crate::wire::Int16Int8> for Int16Int8 { |
| #[inline] |
| fn from_wire_ref(wire: &crate::wire::Int16Int8) -> Self { |
| Self { |
| a: ::fidl_next::FromWireRef::from_wire_ref(&wire.a), |
| |
| b: ::fidl_next::FromWireRef::from_wire_ref(&wire.b), |
| } |
| } |
| } |
| |
| #[derive(PartialEq, Clone, Debug)] |
| pub struct ArrayInt16Int8 { |
| pub arr: [crate::natural::Int16Int8; 3], |
| } |
| |
| unsafe impl<___E> ::fidl_next::Encode<crate::wire::ArrayInt16Int8, ___E> for ArrayInt16Int8 |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<crate::wire::ArrayInt16Int8>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let crate::wire::ArrayInt16Int8 { |
| arr, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(self.arr, encoder_, arr, ())?; |
| |
| let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(arr.as_mut_ptr()) }; |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ArrayInt16Int8, ___E> for &'a ArrayInt16Int8 |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<crate::wire::ArrayInt16Int8>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let crate::wire::ArrayInt16Int8 { |
| |
| arr, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(&self.arr, encoder_, arr, ())?; |
| |
| let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(arr.as_mut_ptr()) }; |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<___E> |
| ::fidl_next::EncodeOption<::fidl_next::WireBox<'static, crate::wire::ArrayInt16Int8>, ___E> |
| for ArrayInt16Int8 |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| ArrayInt16Int8: ::fidl_next::Encode<crate::wire::ArrayInt16Int8, ___E>, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit< |
| ::fidl_next::WireBox<'static, crate::wire::ArrayInt16Int8>, |
| >, |
| _: (), |
| ) -> ::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::ArrayInt16Int8>, ___E> |
| for &'a ArrayInt16Int8 |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| &'a ArrayInt16Int8: ::fidl_next::Encode<crate::wire::ArrayInt16Int8, ___E>, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit< |
| ::fidl_next::WireBox<'static, crate::wire::ArrayInt16Int8>, |
| >, |
| _: (), |
| ) -> ::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::ArrayInt16Int8> for ArrayInt16Int8 { |
| #[inline] |
| fn from_wire(wire: crate::wire::ArrayInt16Int8) -> Self { |
| Self { arr: ::fidl_next::FromWire::from_wire(wire.arr) } |
| } |
| } |
| |
| impl ::fidl_next::FromWireRef<crate::wire::ArrayInt16Int8> for ArrayInt16Int8 { |
| #[inline] |
| fn from_wire_ref(wire: &crate::wire::ArrayInt16Int8) -> Self { |
| Self { arr: ::fidl_next::FromWireRef::from_wire_ref(&wire.arr) } |
| } |
| } |
| |
| #[derive(PartialEq, Clone, Debug)] |
| pub struct Int8Int32 { |
| pub a: i8, |
| |
| pub b: i32, |
| } |
| |
| unsafe impl<___E> ::fidl_next::Encode<crate::wire::Int8Int32, ___E> for Int8Int32 |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<crate::wire::Int8Int32>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let crate::wire::Int8Int32 { |
| a, |
| b, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(self.a, encoder_, a, ())?; |
| |
| let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(a.as_mut_ptr()) }; |
| |
| ::fidl_next::Encode::encode(self.b, encoder_, b, ())?; |
| |
| let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(b.as_mut_ptr()) }; |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Int8Int32, ___E> for &'a Int8Int32 |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<crate::wire::Int8Int32>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let crate::wire::Int8Int32 { |
| |
| a, |
| b, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(&self.a, encoder_, a, ())?; |
| |
| let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(a.as_mut_ptr()) }; |
| |
| ::fidl_next::Encode::encode(&self.b, encoder_, b, ())?; |
| |
| let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(b.as_mut_ptr()) }; |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<___E> |
| ::fidl_next::EncodeOption<::fidl_next::WireBox<'static, crate::wire::Int8Int32>, ___E> |
| for Int8Int32 |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| Int8Int32: ::fidl_next::Encode<crate::wire::Int8Int32, ___E>, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit< |
| ::fidl_next::WireBox<'static, crate::wire::Int8Int32>, |
| >, |
| _: (), |
| ) -> ::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::Int8Int32>, ___E> |
| for &'a Int8Int32 |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| &'a Int8Int32: ::fidl_next::Encode<crate::wire::Int8Int32, ___E>, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit< |
| ::fidl_next::WireBox<'static, crate::wire::Int8Int32>, |
| >, |
| _: (), |
| ) -> ::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::Int8Int32> for Int8Int32 { |
| #[inline] |
| fn from_wire(wire: crate::wire::Int8Int32) -> Self { |
| Self { |
| a: ::fidl_next::FromWire::from_wire(wire.a), |
| |
| b: ::fidl_next::FromWire::from_wire(wire.b), |
| } |
| } |
| } |
| |
| impl ::fidl_next::FromWireRef<crate::wire::Int8Int32> for Int8Int32 { |
| #[inline] |
| fn from_wire_ref(wire: &crate::wire::Int8Int32) -> Self { |
| Self { |
| a: ::fidl_next::FromWireRef::from_wire_ref(&wire.a), |
| |
| b: ::fidl_next::FromWireRef::from_wire_ref(&wire.b), |
| } |
| } |
| } |
| |
| #[derive(PartialEq, Clone, Debug)] |
| pub struct StructPaddingTestStruct { |
| pub trailing: crate::natural::Int16Int8, |
| |
| pub inner: crate::natural::Int8Int32, |
| |
| pub array: crate::natural::ArrayInt16Int8, |
| } |
| |
| unsafe impl<___E> ::fidl_next::Encode<crate::wire::StructPaddingTestStruct, ___E> |
| for StructPaddingTestStruct |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<crate::wire::StructPaddingTestStruct>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let crate::wire::StructPaddingTestStruct { |
| trailing, |
| inner, |
| array, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(self.trailing, encoder_, trailing, ())?; |
| |
| let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(trailing.as_mut_ptr()) }; |
| |
| ::fidl_next::Encode::encode(self.inner, encoder_, inner, ())?; |
| |
| let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(inner.as_mut_ptr()) }; |
| |
| ::fidl_next::Encode::encode(self.array, encoder_, array, ())?; |
| |
| let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(array.as_mut_ptr()) }; |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::StructPaddingTestStruct, ___E> |
| for &'a StructPaddingTestStruct |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<crate::wire::StructPaddingTestStruct>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let crate::wire::StructPaddingTestStruct { |
| |
| trailing, |
| inner, |
| array, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(&self.trailing, encoder_, trailing, ())?; |
| |
| let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(trailing.as_mut_ptr()) }; |
| |
| ::fidl_next::Encode::encode(&self.inner, encoder_, inner, ())?; |
| |
| let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(inner.as_mut_ptr()) }; |
| |
| ::fidl_next::Encode::encode(&self.array, encoder_, array, ())?; |
| |
| let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(array.as_mut_ptr()) }; |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<___E> |
| ::fidl_next::EncodeOption< |
| ::fidl_next::WireBox<'static, crate::wire::StructPaddingTestStruct>, |
| ___E, |
| > for StructPaddingTestStruct |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| StructPaddingTestStruct: ::fidl_next::Encode<crate::wire::StructPaddingTestStruct, ___E>, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit< |
| ::fidl_next::WireBox<'static, crate::wire::StructPaddingTestStruct>, |
| >, |
| _: (), |
| ) -> ::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::StructPaddingTestStruct>, |
| ___E, |
| > for &'a StructPaddingTestStruct |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| &'a StructPaddingTestStruct: |
| ::fidl_next::Encode<crate::wire::StructPaddingTestStruct, ___E>, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit< |
| ::fidl_next::WireBox<'static, crate::wire::StructPaddingTestStruct>, |
| >, |
| _: (), |
| ) -> ::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::StructPaddingTestStruct> for StructPaddingTestStruct { |
| #[inline] |
| fn from_wire(wire: crate::wire::StructPaddingTestStruct) -> Self { |
| Self { |
| trailing: ::fidl_next::FromWire::from_wire(wire.trailing), |
| |
| inner: ::fidl_next::FromWire::from_wire(wire.inner), |
| |
| array: ::fidl_next::FromWire::from_wire(wire.array), |
| } |
| } |
| } |
| |
| impl ::fidl_next::FromWireRef<crate::wire::StructPaddingTestStruct> for StructPaddingTestStruct { |
| #[inline] |
| fn from_wire_ref(wire: &crate::wire::StructPaddingTestStruct) -> Self { |
| Self { |
| trailing: ::fidl_next::FromWireRef::from_wire_ref(&wire.trailing), |
| |
| inner: ::fidl_next::FromWireRef::from_wire_ref(&wire.inner), |
| |
| array: ::fidl_next::FromWireRef::from_wire_ref(&wire.array), |
| } |
| } |
| } |
| } |
| |
| pub mod wire { |
| |
| /// The wire type corresponding to [`Int16Int8`]. |
| #[derive(Clone, Debug)] |
| #[repr(C)] |
| pub struct Int16Int8 { |
| pub a: ::fidl_next::WireI16, |
| |
| pub b: i8, |
| } |
| |
| static_assertions::const_assert_eq!(std::mem::size_of::<Int16Int8>(), 4); |
| static_assertions::const_assert_eq!(std::mem::align_of::<Int16Int8>(), 2); |
| |
| static_assertions::const_assert_eq!(std::mem::offset_of!(Int16Int8, a), 0); |
| |
| static_assertions::const_assert_eq!(std::mem::offset_of!(Int16Int8, b), 2); |
| |
| unsafe impl ::fidl_next::Wire for Int16Int8 { |
| type Owned<'de> = Int16Int8; |
| |
| #[inline] |
| fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) { |
| ::fidl_next::munge! { |
| let Self { |
| |
| a, |
| b, |
| |
| } = &mut *out_; |
| } |
| |
| ::fidl_next::Wire::zero_padding(a); |
| |
| ::fidl_next::Wire::zero_padding(b); |
| |
| unsafe { |
| out_.as_mut_ptr().cast::<u8>().add(3).write_bytes(0, 1); |
| } |
| } |
| } |
| |
| unsafe impl<___D> ::fidl_next::Decode<___D> for Int16Int8 |
| where |
| ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized, |
| { |
| fn decode( |
| slot_: ::fidl_next::Slot<'_, Self>, |
| decoder_: &mut ___D, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::DecodeError> { |
| if slot_.as_bytes()[3..4] != [0u8; 1] { |
| return Err(::fidl_next::DecodeError::InvalidPadding); |
| } |
| |
| ::fidl_next::munge! { |
| let Self { |
| |
| mut a, |
| mut b, |
| |
| } = slot_; |
| } |
| |
| let _field = a.as_mut(); |
| |
| ::fidl_next::Decode::decode(a.as_mut(), decoder_, ())?; |
| |
| let _field = b.as_mut(); |
| |
| ::fidl_next::Decode::decode(b.as_mut(), decoder_, ())?; |
| |
| Ok(()) |
| } |
| } |
| |
| impl ::fidl_next::IntoNatural for Int16Int8 { |
| type Natural = crate::natural::Int16Int8; |
| } |
| |
| impl ::fidl_next::Unconstrained for Int16Int8 {} |
| |
| /// The wire type corresponding to [`ArrayInt16Int8`]. |
| #[derive(Clone, Debug)] |
| #[repr(C)] |
| pub struct ArrayInt16Int8 { |
| pub arr: [crate::wire::Int16Int8; 3], |
| } |
| |
| static_assertions::const_assert_eq!(std::mem::size_of::<ArrayInt16Int8>(), 12); |
| static_assertions::const_assert_eq!(std::mem::align_of::<ArrayInt16Int8>(), 2); |
| |
| static_assertions::const_assert_eq!(std::mem::offset_of!(ArrayInt16Int8, arr), 0); |
| |
| unsafe impl ::fidl_next::Wire for ArrayInt16Int8 { |
| type Owned<'de> = ArrayInt16Int8; |
| |
| #[inline] |
| fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) { |
| ::fidl_next::munge! { |
| let Self { |
| |
| arr, |
| |
| } = &mut *out_; |
| } |
| |
| ::fidl_next::Wire::zero_padding(arr); |
| } |
| } |
| |
| unsafe impl<___D> ::fidl_next::Decode<___D> for ArrayInt16Int8 |
| 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 arr, |
| |
| } = slot_; |
| } |
| |
| let _field = arr.as_mut(); |
| |
| ::fidl_next::Decode::decode(arr.as_mut(), decoder_, ())?; |
| |
| Ok(()) |
| } |
| } |
| |
| impl ::fidl_next::IntoNatural for ArrayInt16Int8 { |
| type Natural = crate::natural::ArrayInt16Int8; |
| } |
| |
| impl ::fidl_next::Unconstrained for ArrayInt16Int8 {} |
| |
| /// The wire type corresponding to [`Int8Int32`]. |
| #[derive(Clone, Debug)] |
| #[repr(C)] |
| pub struct Int8Int32 { |
| pub a: i8, |
| |
| pub b: ::fidl_next::WireI32, |
| } |
| |
| static_assertions::const_assert_eq!(std::mem::size_of::<Int8Int32>(), 8); |
| static_assertions::const_assert_eq!(std::mem::align_of::<Int8Int32>(), 4); |
| |
| static_assertions::const_assert_eq!(std::mem::offset_of!(Int8Int32, a), 0); |
| |
| static_assertions::const_assert_eq!(std::mem::offset_of!(Int8Int32, b), 4); |
| |
| unsafe impl ::fidl_next::Wire for Int8Int32 { |
| type Owned<'de> = Int8Int32; |
| |
| #[inline] |
| fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) { |
| ::fidl_next::munge! { |
| let Self { |
| |
| a, |
| b, |
| |
| } = &mut *out_; |
| } |
| |
| ::fidl_next::Wire::zero_padding(a); |
| |
| ::fidl_next::Wire::zero_padding(b); |
| |
| unsafe { |
| out_.as_mut_ptr().cast::<u8>().add(1).write_bytes(0, 3); |
| } |
| } |
| } |
| |
| unsafe impl<___D> ::fidl_next::Decode<___D> for Int8Int32 |
| where |
| ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized, |
| { |
| fn decode( |
| slot_: ::fidl_next::Slot<'_, Self>, |
| decoder_: &mut ___D, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::DecodeError> { |
| if slot_.as_bytes()[1..4] != [0u8; 3] { |
| return Err(::fidl_next::DecodeError::InvalidPadding); |
| } |
| |
| ::fidl_next::munge! { |
| let Self { |
| |
| mut a, |
| mut b, |
| |
| } = slot_; |
| } |
| |
| let _field = a.as_mut(); |
| |
| ::fidl_next::Decode::decode(a.as_mut(), decoder_, ())?; |
| |
| let _field = b.as_mut(); |
| |
| ::fidl_next::Decode::decode(b.as_mut(), decoder_, ())?; |
| |
| Ok(()) |
| } |
| } |
| |
| impl ::fidl_next::IntoNatural for Int8Int32 { |
| type Natural = crate::natural::Int8Int32; |
| } |
| |
| impl ::fidl_next::Unconstrained for Int8Int32 {} |
| |
| /// The wire type corresponding to [`StructPaddingTestStruct`]. |
| #[derive(Clone, Debug)] |
| #[repr(C)] |
| pub struct StructPaddingTestStruct { |
| pub trailing: crate::wire::Int16Int8, |
| |
| pub inner: crate::wire::Int8Int32, |
| |
| pub array: crate::wire::ArrayInt16Int8, |
| } |
| |
| static_assertions::const_assert_eq!(std::mem::size_of::<StructPaddingTestStruct>(), 24); |
| static_assertions::const_assert_eq!(std::mem::align_of::<StructPaddingTestStruct>(), 4); |
| |
| static_assertions::const_assert_eq!(std::mem::offset_of!(StructPaddingTestStruct, trailing), 0); |
| |
| static_assertions::const_assert_eq!(std::mem::offset_of!(StructPaddingTestStruct, inner), 4); |
| |
| static_assertions::const_assert_eq!(std::mem::offset_of!(StructPaddingTestStruct, array), 12); |
| |
| unsafe impl ::fidl_next::Wire for StructPaddingTestStruct { |
| type Owned<'de> = StructPaddingTestStruct; |
| |
| #[inline] |
| fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) { |
| ::fidl_next::munge! { |
| let Self { |
| |
| trailing, |
| inner, |
| array, |
| |
| } = &mut *out_; |
| } |
| |
| ::fidl_next::Wire::zero_padding(trailing); |
| |
| ::fidl_next::Wire::zero_padding(inner); |
| |
| ::fidl_next::Wire::zero_padding(array); |
| } |
| } |
| |
| unsafe impl<___D> ::fidl_next::Decode<___D> for StructPaddingTestStruct |
| 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 trailing, |
| mut inner, |
| mut array, |
| |
| } = slot_; |
| } |
| |
| let _field = trailing.as_mut(); |
| |
| ::fidl_next::Decode::decode(trailing.as_mut(), decoder_, ())?; |
| |
| let _field = inner.as_mut(); |
| |
| ::fidl_next::Decode::decode(inner.as_mut(), decoder_, ())?; |
| |
| let _field = array.as_mut(); |
| |
| ::fidl_next::Decode::decode(array.as_mut(), decoder_, ())?; |
| |
| Ok(()) |
| } |
| } |
| |
| impl ::fidl_next::IntoNatural for StructPaddingTestStruct { |
| type Natural = crate::natural::StructPaddingTestStruct; |
| } |
| |
| impl ::fidl_next::Unconstrained for StructPaddingTestStruct {} |
| } |
| |
| pub mod wire_optional {} |
| |
| pub mod generic { |
| |
| pub struct Int16Int8<T0, T1> { |
| pub a: T0, |
| |
| pub b: T1, |
| } |
| |
| unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::Int16Int8, ___E> for Int16Int8<T0, T1> |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| T0: ::fidl_next::Encode<::fidl_next::WireI16, ___E>, |
| T1: ::fidl_next::Encode<i8, ___E>, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<crate::wire::Int16Int8>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let crate::wire::Int16Int8 { |
| |
| a, |
| b, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(self.a, encoder_, a, ())?; |
| |
| ::fidl_next::Encode::encode(self.b, encoder_, b, ())?; |
| |
| Ok(()) |
| } |
| } |
| |
| pub struct ArrayInt16Int8<T0> { |
| pub arr: T0, |
| } |
| |
| unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::ArrayInt16Int8, ___E> for ArrayInt16Int8<T0> |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| T0: ::fidl_next::Encode<[crate::wire::Int16Int8; 3], ___E>, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<crate::wire::ArrayInt16Int8>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let crate::wire::ArrayInt16Int8 { |
| |
| arr, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(self.arr, encoder_, arr, ())?; |
| |
| Ok(()) |
| } |
| } |
| |
| pub struct Int8Int32<T0, T1> { |
| pub a: T0, |
| |
| pub b: T1, |
| } |
| |
| unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::Int8Int32, ___E> for Int8Int32<T0, T1> |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| T0: ::fidl_next::Encode<i8, ___E>, |
| T1: ::fidl_next::Encode<::fidl_next::WireI32, ___E>, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<crate::wire::Int8Int32>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let crate::wire::Int8Int32 { |
| |
| a, |
| b, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(self.a, encoder_, a, ())?; |
| |
| ::fidl_next::Encode::encode(self.b, encoder_, b, ())?; |
| |
| Ok(()) |
| } |
| } |
| |
| pub struct StructPaddingTestStruct<T0, T1, T2> { |
| pub trailing: T0, |
| |
| pub inner: T1, |
| |
| pub array: T2, |
| } |
| |
| unsafe impl<___E, T0, T1, T2> ::fidl_next::Encode<crate::wire::StructPaddingTestStruct, ___E> |
| for StructPaddingTestStruct<T0, T1, T2> |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| T0: ::fidl_next::Encode<crate::wire::Int16Int8, ___E>, |
| T1: ::fidl_next::Encode<crate::wire::Int8Int32, ___E>, |
| T2: ::fidl_next::Encode<crate::wire::ArrayInt16Int8, ___E>, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<crate::wire::StructPaddingTestStruct>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let crate::wire::StructPaddingTestStruct { |
| |
| trailing, |
| inner, |
| array, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(self.trailing, encoder_, trailing, ())?; |
| |
| ::fidl_next::Encode::encode(self.inner, encoder_, inner, ())?; |
| |
| ::fidl_next::Encode::encode(self.array, encoder_, array, ())?; |
| |
| 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::Int16Int8> for ::fidl_test_encapsulatedstructs::Int16Int8 { |
| #[inline] |
| fn compat_from(value: crate::Int16Int8) -> Self { |
| Self { |
| a: ::fidl_next::CompatFrom::compat_from(value.a), |
| |
| b: ::fidl_next::CompatFrom::compat_from(value.b), |
| } |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<::fidl_test_encapsulatedstructs::Int16Int8> for crate::Int16Int8 { |
| #[inline] |
| fn compat_from(value: ::fidl_test_encapsulatedstructs::Int16Int8) -> Self { |
| Self { |
| a: ::fidl_next::CompatFrom::compat_from(value.a), |
| |
| b: ::fidl_next::CompatFrom::compat_from(value.b), |
| } |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<crate::ArrayInt16Int8> |
| for ::fidl_test_encapsulatedstructs::ArrayInt16Int8 |
| { |
| #[inline] |
| fn compat_from(value: crate::ArrayInt16Int8) -> Self { |
| Self { arr: ::fidl_next::CompatFrom::compat_from(value.arr) } |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<::fidl_test_encapsulatedstructs::ArrayInt16Int8> |
| for crate::ArrayInt16Int8 |
| { |
| #[inline] |
| fn compat_from(value: ::fidl_test_encapsulatedstructs::ArrayInt16Int8) -> Self { |
| Self { arr: ::fidl_next::CompatFrom::compat_from(value.arr) } |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<crate::Int8Int32> for ::fidl_test_encapsulatedstructs::Int8Int32 { |
| #[inline] |
| fn compat_from(value: crate::Int8Int32) -> Self { |
| Self { |
| a: ::fidl_next::CompatFrom::compat_from(value.a), |
| |
| b: ::fidl_next::CompatFrom::compat_from(value.b), |
| } |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<::fidl_test_encapsulatedstructs::Int8Int32> for crate::Int8Int32 { |
| #[inline] |
| fn compat_from(value: ::fidl_test_encapsulatedstructs::Int8Int32) -> Self { |
| Self { |
| a: ::fidl_next::CompatFrom::compat_from(value.a), |
| |
| b: ::fidl_next::CompatFrom::compat_from(value.b), |
| } |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<crate::StructPaddingTestStruct> |
| for ::fidl_test_encapsulatedstructs::StructPaddingTestStruct |
| { |
| #[inline] |
| fn compat_from(value: crate::StructPaddingTestStruct) -> Self { |
| Self { |
| trailing: ::fidl_next::CompatFrom::compat_from(value.trailing), |
| |
| inner: ::fidl_next::CompatFrom::compat_from(value.inner), |
| |
| array: ::fidl_next::CompatFrom::compat_from(value.array), |
| } |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<::fidl_test_encapsulatedstructs::StructPaddingTestStruct> |
| for crate::StructPaddingTestStruct |
| { |
| #[inline] |
| fn compat_from(value: ::fidl_test_encapsulatedstructs::StructPaddingTestStruct) -> Self { |
| Self { |
| trailing: ::fidl_next::CompatFrom::compat_from(value.trailing), |
| |
| inner: ::fidl_next::CompatFrom::compat_from(value.inner), |
| |
| array: ::fidl_next::CompatFrom::compat_from(value.array), |
| } |
| } |
| } |
| } |