| // 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 SerializableStruct {} |
| |
| unsafe impl<___E> ::fidl_next::Encode<crate::wire::SerializableStruct, ___E> for SerializableStruct |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<crate::wire::SerializableStruct>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| *out_ = ::core::mem::MaybeUninit::zeroed(); |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SerializableStruct, ___E> |
| for &'a SerializableStruct |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<crate::wire::SerializableStruct>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let crate::wire::SerializableStruct { |
| |
| _empty, |
| |
| |
| } = out_; |
| } |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<___E> |
| ::fidl_next::EncodeOption< |
| ::fidl_next::WireBox<'static, crate::wire::SerializableStruct>, |
| ___E, |
| > for SerializableStruct |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| SerializableStruct: ::fidl_next::Encode<crate::wire::SerializableStruct, ___E>, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit< |
| ::fidl_next::WireBox<'static, crate::wire::SerializableStruct>, |
| >, |
| _: (), |
| ) -> ::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::SerializableStruct>, |
| ___E, |
| > for &'a SerializableStruct |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| &'a SerializableStruct: ::fidl_next::Encode<crate::wire::SerializableStruct, ___E>, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit< |
| ::fidl_next::WireBox<'static, crate::wire::SerializableStruct>, |
| >, |
| _: (), |
| ) -> ::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::SerializableStruct> for SerializableStruct { |
| const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization< |
| crate::wire::SerializableStruct, |
| Self, |
| > = unsafe { ::fidl_next::CopyOptimization::enable_if(true) }; |
| |
| #[inline] |
| fn from_wire(wire: crate::wire::SerializableStruct) -> Self { |
| Self {} |
| } |
| } |
| |
| impl ::fidl_next::FromWireRef<crate::wire::SerializableStruct> for SerializableStruct { |
| #[inline] |
| fn from_wire_ref(wire: &crate::wire::SerializableStruct) -> Self { |
| Self {} |
| } |
| } |
| |
| #[derive(PartialEq, Clone, Debug, Default)] |
| pub struct SerializableTable {} |
| |
| impl SerializableTable { |
| fn __max_ordinal(&self) -> usize { |
| 0 |
| } |
| } |
| |
| unsafe impl<___E> ::fidl_next::Encode<crate::wire::SerializableTable<'static>, ___E> |
| for SerializableTable |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| { |
| #[inline] |
| fn encode( |
| mut self, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit<crate::wire::SerializableTable<'static>>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge!(let crate::wire::SerializableTable { table } = out); |
| |
| let max_ord = self.__max_ordinal(); |
| |
| let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit(); |
| ::fidl_next::Wire::zero_padding(&mut out); |
| |
| let mut preallocated = |
| ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord); |
| |
| for i in 1..=max_ord { |
| match i { |
| _ => ::fidl_next::WireEnvelope::encode_zero(&mut out), |
| } |
| unsafe { |
| preallocated.write_next(out.assume_init_ref()); |
| } |
| } |
| |
| ::fidl_next::WireTable::encode_len(table, max_ord); |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SerializableTable<'static>, ___E> |
| for &'a SerializableTable |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit<crate::wire::SerializableTable<'static>>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge!(let crate::wire::SerializableTable { table } = out); |
| |
| let max_ord = self.__max_ordinal(); |
| |
| let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit(); |
| ::fidl_next::Wire::zero_padding(&mut out); |
| |
| let mut preallocated = |
| ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord); |
| |
| for i in 1..=max_ord { |
| match i { |
| _ => ::fidl_next::WireEnvelope::encode_zero(&mut out), |
| } |
| unsafe { |
| preallocated.write_next(out.assume_init_ref()); |
| } |
| } |
| |
| ::fidl_next::WireTable::encode_len(table, max_ord); |
| |
| Ok(()) |
| } |
| } |
| |
| impl<'de> ::fidl_next::FromWire<crate::wire::SerializableTable<'de>> for SerializableTable { |
| #[inline] |
| fn from_wire(wire_: crate::wire::SerializableTable<'de>) -> Self { |
| let wire_ = ::core::mem::ManuallyDrop::new(wire_); |
| |
| Self {} |
| } |
| } |
| |
| impl<'de> ::fidl_next::FromWireRef<crate::wire::SerializableTable<'de>> for SerializableTable { |
| #[inline] |
| fn from_wire_ref(wire: &crate::wire::SerializableTable<'de>) -> Self { |
| Self {} |
| } |
| } |
| |
| #[derive(PartialEq, Clone, Debug)] |
| pub enum SerializableUnion { |
| Unused(bool), |
| } |
| |
| unsafe impl<___E> ::fidl_next::Encode<crate::wire::SerializableUnion, ___E> for SerializableUnion |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit<crate::wire::SerializableUnion>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge!(let crate::wire::SerializableUnion { raw, _phantom: _ } = out); |
| |
| match self { |
| Self::Unused(value) => ::fidl_next::RawWireUnion::encode_as_static::<___E, bool>( |
| value, |
| 1, |
| encoder, |
| raw, |
| (), |
| )?, |
| } |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SerializableUnion, ___E> |
| for &'a SerializableUnion |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit<crate::wire::SerializableUnion>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge!(let crate::wire::SerializableUnion { raw, _phantom: _ } = out); |
| |
| match self { |
| SerializableUnion::Unused(value) => ::fidl_next::RawWireUnion::encode_as_static::< |
| ___E, |
| bool, |
| >(value, 1, encoder, raw, ())?, |
| } |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<___E> ::fidl_next::EncodeOption<crate::wire_optional::SerializableUnion, ___E> |
| for SerializableUnion |
| where |
| ___E: ?Sized, |
| SerializableUnion: ::fidl_next::Encode<crate::wire::SerializableUnion, ___E>, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit<crate::wire_optional::SerializableUnion>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge!(let crate::wire_optional::SerializableUnion { raw, _phantom: _ } = &mut *out); |
| |
| if let Some(inner) = this { |
| let value_out = unsafe { &mut *out.as_mut_ptr().cast() }; |
| ::fidl_next::Encode::encode(inner, encoder, value_out, ())?; |
| } else { |
| ::fidl_next::RawWireUnion::encode_absent(raw); |
| } |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<'a, ___E> ::fidl_next::EncodeOption<crate::wire_optional::SerializableUnion, ___E> |
| for &'a SerializableUnion |
| where |
| ___E: ?Sized, |
| &'a SerializableUnion: ::fidl_next::Encode<crate::wire::SerializableUnion, ___E>, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit<crate::wire_optional::SerializableUnion>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge!(let crate::wire_optional::SerializableUnion { raw, _phantom: _ } = &mut *out); |
| |
| if let Some(inner) = this { |
| let value_out = unsafe { &mut *out.as_mut_ptr().cast() }; |
| ::fidl_next::Encode::encode(inner, encoder, value_out, ())?; |
| } else { |
| ::fidl_next::RawWireUnion::encode_absent(raw); |
| } |
| |
| Ok(()) |
| } |
| } |
| |
| impl ::fidl_next::FromWire<crate::wire::SerializableUnion> for SerializableUnion { |
| #[inline] |
| fn from_wire(wire: crate::wire::SerializableUnion) -> Self { |
| let wire = ::core::mem::ManuallyDrop::new(wire); |
| match wire.raw.ordinal() { |
| 1 => Self::Unused(::fidl_next::FromWire::from_wire(unsafe { |
| wire.raw.get().read_unchecked::<bool>() |
| })), |
| |
| _ => unsafe { ::core::hint::unreachable_unchecked() }, |
| } |
| } |
| } |
| |
| impl ::fidl_next::FromWireRef<crate::wire::SerializableUnion> for SerializableUnion { |
| #[inline] |
| fn from_wire_ref(wire: &crate::wire::SerializableUnion) -> Self { |
| match wire.raw.ordinal() { |
| 1 => Self::Unused(::fidl_next::FromWireRef::from_wire_ref(unsafe { |
| wire.raw.get().deref_unchecked::<bool>() |
| })), |
| |
| _ => unsafe { ::core::hint::unreachable_unchecked() }, |
| } |
| } |
| } |
| |
| impl ::fidl_next::FromWireOption<crate::wire_optional::SerializableUnion> for SerializableUnion { |
| #[inline] |
| fn from_wire_option( |
| wire: crate::wire_optional::SerializableUnion, |
| ) -> ::core::option::Option<Self> { |
| if let Some(inner) = wire.into_option() { |
| Some(::fidl_next::FromWire::from_wire(inner)) |
| } else { |
| None |
| } |
| } |
| } |
| |
| impl ::fidl_next::FromWireOption<crate::wire_optional::SerializableUnion> |
| for Box<SerializableUnion> |
| { |
| #[inline] |
| fn from_wire_option( |
| wire: crate::wire_optional::SerializableUnion, |
| ) -> ::core::option::Option<Self> { |
| <SerializableUnion as ::fidl_next::FromWireOption< |
| crate::wire_optional::SerializableUnion, |
| >>::from_wire_option(wire) |
| .map(Box::new) |
| } |
| } |
| |
| impl ::fidl_next::FromWireOptionRef<crate::wire_optional::SerializableUnion> |
| for Box<SerializableUnion> |
| { |
| #[inline] |
| fn from_wire_option_ref( |
| wire: &crate::wire_optional::SerializableUnion, |
| ) -> ::core::option::Option<Self> { |
| if let Some(inner) = wire.as_ref() { |
| Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner))) |
| } else { |
| None |
| } |
| } |
| } |
| } |
| |
| pub mod wire { |
| |
| /// The wire type corresponding to [`SerializableStruct`]. |
| #[derive(Clone, Debug)] |
| #[repr(C)] |
| pub struct SerializableStruct { |
| pub(crate) _empty: fidl_next::WireEmptyStructPlaceholder, |
| } |
| |
| static_assertions::const_assert_eq!(std::mem::size_of::<SerializableStruct>(), 1); |
| static_assertions::const_assert_eq!(std::mem::align_of::<SerializableStruct>(), 1); |
| |
| unsafe impl ::fidl_next::Wire for SerializableStruct { |
| type Owned<'de> = SerializableStruct; |
| |
| #[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 SerializableStruct |
| 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 SerializableStruct { |
| type Natural = crate::natural::SerializableStruct; |
| } |
| |
| impl ::fidl_next::Unconstrained for SerializableStruct {} |
| |
| /// The wire type corresponding to [`SerializableTable`]. |
| #[repr(C)] |
| pub struct SerializableTable<'de> { |
| pub(crate) table: ::fidl_next::WireTable<'de>, |
| } |
| |
| impl<'de> Drop for SerializableTable<'de> { |
| fn drop(&mut self) {} |
| } |
| |
| unsafe impl ::fidl_next::Wire for SerializableTable<'static> { |
| type Owned<'de> = SerializableTable<'de>; |
| |
| #[inline] |
| fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) { |
| ::fidl_next::munge!(let Self { table } = out); |
| ::fidl_next::WireTable::zero_padding(table); |
| } |
| } |
| |
| unsafe impl<___D> ::fidl_next::Decode<___D> for SerializableTable<'static> |
| where |
| ___D: ::fidl_next::Decoder + ?Sized, |
| { |
| fn decode( |
| slot: ::fidl_next::Slot<'_, Self>, |
| decoder: &mut ___D, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::DecodeError> { |
| ::fidl_next::munge!(let Self { table } = slot); |
| |
| ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| { |
| match ordinal { |
| 0 => unsafe { ::core::hint::unreachable_unchecked() }, |
| |
| _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder), |
| } |
| }) |
| } |
| } |
| |
| impl<'de> SerializableTable<'de> {} |
| |
| impl<'de> ::core::fmt::Debug for SerializableTable<'de> { |
| fn fmt( |
| &self, |
| f: &mut ::core::fmt::Formatter<'_>, |
| ) -> ::core::result::Result<(), ::core::fmt::Error> { |
| f.debug_struct("SerializableTable").finish() |
| } |
| } |
| |
| impl<'de> ::fidl_next::IntoNatural for SerializableTable<'de> { |
| type Natural = crate::natural::SerializableTable; |
| } |
| |
| impl ::fidl_next::Unconstrained for SerializableTable<'_> {} |
| |
| /// The wire type corresponding to [`SerializableUnion`]. |
| #[repr(transparent)] |
| pub struct SerializableUnion { |
| pub(crate) raw: ::fidl_next::RawWireUnion, |
| pub(crate) _phantom: ::core::marker::PhantomData<()>, |
| } |
| |
| impl Drop for SerializableUnion { |
| fn drop(&mut self) { |
| match self.raw.ordinal() { |
| 1 => { |
| let _ = unsafe { self.raw.get().read_unchecked::<bool>() }; |
| } |
| |
| _ => unsafe { ::core::hint::unreachable_unchecked() }, |
| } |
| } |
| } |
| |
| unsafe impl ::fidl_next::Wire for SerializableUnion { |
| type Owned<'de> = SerializableUnion; |
| |
| #[inline] |
| fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) { |
| ::fidl_next::munge!(let Self { raw, _phantom: _ } = out); |
| ::fidl_next::RawWireUnion::zero_padding(raw); |
| } |
| } |
| |
| pub mod serializable_union { |
| pub enum Ref<'de> { |
| Unused(&'de bool), |
| } |
| } |
| |
| impl SerializableUnion { |
| pub fn as_ref(&self) -> crate::wire::serializable_union::Ref<'_> { |
| match self.raw.ordinal() { |
| 1 => crate::wire::serializable_union::Ref::Unused(unsafe { |
| self.raw.get().deref_unchecked::<bool>() |
| }), |
| |
| _ => unsafe { ::core::hint::unreachable_unchecked() }, |
| } |
| } |
| } |
| |
| impl Clone for SerializableUnion { |
| fn clone(&self) -> Self { |
| match self.raw.ordinal() { |
| 1 => Self { |
| raw: unsafe { self.raw.clone_inline_unchecked::<bool>() }, |
| _phantom: ::core::marker::PhantomData, |
| }, |
| |
| _ => unsafe { ::core::hint::unreachable_unchecked() }, |
| } |
| } |
| } |
| |
| unsafe impl<___D> ::fidl_next::Decode<___D> for SerializableUnion |
| where |
| ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized, |
| { |
| fn decode( |
| mut slot: ::fidl_next::Slot<'_, Self>, |
| decoder: &mut ___D, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::DecodeError> { |
| ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut()); |
| match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) { |
| 1 => ::fidl_next::RawWireUnion::decode_as_static::<___D, bool>(raw, decoder, ())?, |
| |
| ord => return Err(::fidl_next::DecodeError::InvalidUnionOrdinal(ord as usize)), |
| } |
| |
| Ok(()) |
| } |
| } |
| |
| impl ::core::fmt::Debug for SerializableUnion { |
| fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { |
| match self.raw.ordinal() { |
| 1 => unsafe { self.raw.get().deref_unchecked::<bool>().fmt(f) }, |
| _ => unsafe { ::core::hint::unreachable_unchecked() }, |
| } |
| } |
| } |
| |
| impl ::fidl_next::IntoNatural for SerializableUnion { |
| type Natural = crate::natural::SerializableUnion; |
| } |
| |
| impl ::fidl_next::Unconstrained for SerializableUnion {} |
| } |
| |
| pub mod wire_optional { |
| |
| #[repr(transparent)] |
| pub struct SerializableUnion { |
| pub(crate) raw: ::fidl_next::RawWireUnion, |
| pub(crate) _phantom: ::core::marker::PhantomData<()>, |
| } |
| |
| unsafe impl ::fidl_next::Wire for SerializableUnion { |
| type Owned<'de> = SerializableUnion; |
| |
| #[inline] |
| fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) { |
| ::fidl_next::munge!(let Self { raw, _phantom: _ } = out); |
| ::fidl_next::RawWireUnion::zero_padding(raw); |
| } |
| } |
| |
| impl SerializableUnion { |
| pub fn is_some(&self) -> bool { |
| self.raw.is_some() |
| } |
| |
| pub fn is_none(&self) -> bool { |
| self.raw.is_none() |
| } |
| |
| pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::SerializableUnion> { |
| if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None } |
| } |
| |
| pub fn into_option(self) -> ::core::option::Option<crate::wire::SerializableUnion> { |
| if self.is_some() { |
| Some(crate::wire::SerializableUnion { |
| raw: self.raw, |
| _phantom: ::core::marker::PhantomData, |
| }) |
| } else { |
| None |
| } |
| } |
| } |
| |
| impl Clone for SerializableUnion { |
| fn clone(&self) -> Self { |
| if self.is_none() { |
| return SerializableUnion { |
| raw: ::fidl_next::RawWireUnion::absent(), |
| _phantom: ::core::marker::PhantomData, |
| }; |
| } |
| |
| match self.raw.ordinal() { |
| 1 => Self { |
| raw: unsafe { self.raw.clone_inline_unchecked::<bool>() }, |
| _phantom: ::core::marker::PhantomData, |
| }, |
| |
| _ => unsafe { ::core::hint::unreachable_unchecked() }, |
| } |
| } |
| } |
| |
| unsafe impl<___D> ::fidl_next::Decode<___D> for SerializableUnion |
| where |
| ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized, |
| { |
| fn decode( |
| mut slot: ::fidl_next::Slot<'_, Self>, |
| decoder: &mut ___D, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::DecodeError> { |
| ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut()); |
| match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) { |
| 1 => ::fidl_next::RawWireUnion::decode_as_static::<___D, bool>(raw, decoder, ())?, |
| |
| 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?, |
| _ => ::fidl_next::RawWireUnion::decode_unknown_static(raw, decoder)?, |
| } |
| |
| Ok(()) |
| } |
| } |
| |
| impl ::core::fmt::Debug for SerializableUnion { |
| fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { |
| self.as_ref().fmt(f) |
| } |
| } |
| |
| impl ::fidl_next::IntoNatural for SerializableUnion { |
| type Natural = ::core::option::Option<crate::natural::SerializableUnion>; |
| } |
| |
| impl ::fidl_next::Unconstrained for SerializableUnion {} |
| } |
| |
| pub mod generic { |
| |
| pub struct SerializableStruct {} |
| |
| unsafe impl<___E> ::fidl_next::Encode<crate::wire::SerializableStruct, ___E> for SerializableStruct |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<crate::wire::SerializableStruct>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let crate::wire::SerializableStruct { |
| |
| _empty, |
| |
| |
| } = out_; |
| } |
| |
| 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::SerializableStruct> |
| for ::fidl_test_serializable::SerializableStruct |
| { |
| #[inline] |
| fn compat_from(value: crate::SerializableStruct) -> Self { |
| Self {} |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<::fidl_test_serializable::SerializableStruct> |
| for crate::SerializableStruct |
| { |
| #[inline] |
| fn compat_from(value: ::fidl_test_serializable::SerializableStruct) -> Self { |
| Self {} |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<crate::SerializableTable> |
| for ::fidl_test_serializable::SerializableTable |
| { |
| fn compat_from(value: crate::SerializableTable) -> Self { |
| Self { __source_breaking: ::fidl::marker::SourceBreaking } |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<::fidl_test_serializable::SerializableTable> |
| for crate::SerializableTable |
| { |
| fn compat_from(value: ::fidl_test_serializable::SerializableTable) -> Self { |
| Self {} |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<crate::SerializableUnion> |
| for ::fidl_test_serializable::SerializableUnion |
| { |
| fn compat_from(value: crate::SerializableUnion) -> Self { |
| match value { |
| crate::SerializableUnion::Unused(value) => { |
| Self::Unused(::fidl_next::CompatFrom::compat_from(value)) |
| } |
| } |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<::fidl_test_serializable::SerializableUnion> |
| for crate::SerializableUnion |
| { |
| fn compat_from(value: ::fidl_test_serializable::SerializableUnion) -> Self { |
| match value { |
| ::fidl_test_serializable::SerializableUnion::Unused(value) => { |
| Self::Unused(::fidl_next::CompatFrom::compat_from(value)) |
| } |
| } |
| } |
| } |
| } |