| // 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, Default)] |
| pub struct LocalTablePayload { |
| pub a: ::core::option::Option<u16>, |
| } |
| |
| impl LocalTablePayload { |
| fn __max_ordinal(&self) -> usize { |
| if self.a.is_some() { |
| return 1; |
| } |
| |
| 0 |
| } |
| } |
| |
| unsafe impl<___E> ::fidl_next::Encode<crate::wire::LocalTablePayload<'static>, ___E> |
| for LocalTablePayload |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| { |
| #[inline] |
| fn encode( |
| mut self, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit<crate::wire::LocalTablePayload<'static>>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge!(let crate::wire::LocalTablePayload { 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 { |
| 1 => { |
| if let Some(value) = self.a.take() { |
| ::fidl_next::WireEnvelope::encode_value::<::fidl_next::WireU16, ___E>( |
| value, |
| preallocated.encoder, |
| &mut out, |
| (), |
| )?; |
| } else { |
| ::fidl_next::WireEnvelope::encode_zero(&mut out) |
| } |
| } |
| |
| _ => ::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::LocalTablePayload<'static>, ___E> |
| for &'a LocalTablePayload |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit<crate::wire::LocalTablePayload<'static>>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge!(let crate::wire::LocalTablePayload { 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 { |
| 1 => { |
| if let Some(value) = &self.a { |
| ::fidl_next::WireEnvelope::encode_value::<::fidl_next::WireU16, ___E>( |
| value, |
| preallocated.encoder, |
| &mut out, |
| (), |
| )?; |
| } else { |
| ::fidl_next::WireEnvelope::encode_zero(&mut out) |
| } |
| } |
| |
| _ => ::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::LocalTablePayload<'de>> for LocalTablePayload { |
| #[inline] |
| fn from_wire(wire_: crate::wire::LocalTablePayload<'de>) -> Self { |
| let wire_ = ::core::mem::ManuallyDrop::new(wire_); |
| |
| let a = wire_.table.get(1); |
| |
| Self { |
| a: a.map(|envelope| { |
| ::fidl_next::FromWire::from_wire(unsafe { |
| envelope.read_unchecked::<::fidl_next::WireU16>() |
| }) |
| }), |
| } |
| } |
| } |
| |
| impl<'de> ::fidl_next::FromWireRef<crate::wire::LocalTablePayload<'de>> for LocalTablePayload { |
| #[inline] |
| fn from_wire_ref(wire: &crate::wire::LocalTablePayload<'de>) -> Self { |
| Self { |
| a: wire.table.get(1).map(|envelope| { |
| ::fidl_next::FromWireRef::from_wire_ref(unsafe { |
| envelope.deref_unchecked::<::fidl_next::WireU16>() |
| }) |
| }), |
| } |
| } |
| } |
| |
| #[derive(PartialEq, Clone, Debug)] |
| pub enum LocalUnionPayload { |
| B(bool), |
| |
| UnknownOrdinal_(u64), |
| } |
| |
| impl LocalUnionPayload { |
| pub fn is_unknown(&self) -> bool { |
| #[allow(unreachable_patterns)] |
| match self { |
| Self::UnknownOrdinal_(_) => true, |
| _ => false, |
| } |
| } |
| } |
| |
| unsafe impl<___E> ::fidl_next::Encode<crate::wire::LocalUnionPayload<'static>, ___E> |
| for LocalUnionPayload |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| ___E: ::fidl_next::Encoder, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit<crate::wire::LocalUnionPayload<'static>>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge!(let crate::wire::LocalUnionPayload { raw, _phantom: _ } = out); |
| |
| match self { |
| Self::B(value) => { |
| ::fidl_next::RawWireUnion::encode_as::<___E, bool>(value, 1, encoder, raw, ())? |
| } |
| |
| Self::UnknownOrdinal_(ordinal) => { |
| return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize)); |
| } |
| } |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::LocalUnionPayload<'static>, ___E> |
| for &'a LocalUnionPayload |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| ___E: ::fidl_next::Encoder, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit<crate::wire::LocalUnionPayload<'static>>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge!(let crate::wire::LocalUnionPayload { raw, _phantom: _ } = out); |
| |
| match self { |
| LocalUnionPayload::B(value) => { |
| ::fidl_next::RawWireUnion::encode_as::<___E, bool>(value, 1, encoder, raw, ())? |
| } |
| |
| LocalUnionPayload::UnknownOrdinal_(ordinal) => { |
| return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize)); |
| } |
| } |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<___E> |
| ::fidl_next::EncodeOption<crate::wire_optional::LocalUnionPayload<'static>, ___E> |
| for LocalUnionPayload |
| where |
| ___E: ?Sized, |
| LocalUnionPayload: ::fidl_next::Encode<crate::wire::LocalUnionPayload<'static>, ___E>, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit<crate::wire_optional::LocalUnionPayload<'static>>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge!(let crate::wire_optional::LocalUnionPayload { 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::LocalUnionPayload<'static>, ___E> |
| for &'a LocalUnionPayload |
| where |
| ___E: ?Sized, |
| &'a LocalUnionPayload: ::fidl_next::Encode<crate::wire::LocalUnionPayload<'static>, ___E>, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit<crate::wire_optional::LocalUnionPayload<'static>>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge!(let crate::wire_optional::LocalUnionPayload { 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<'de> ::fidl_next::FromWire<crate::wire::LocalUnionPayload<'de>> for LocalUnionPayload { |
| #[inline] |
| fn from_wire(wire: crate::wire::LocalUnionPayload<'de>) -> Self { |
| let wire = ::core::mem::ManuallyDrop::new(wire); |
| match wire.raw.ordinal() { |
| 1 => Self::B(::fidl_next::FromWire::from_wire(unsafe { |
| wire.raw.get().read_unchecked::<bool>() |
| })), |
| |
| ord => return Self::UnknownOrdinal_(ord as u64), |
| } |
| } |
| } |
| |
| impl<'de> ::fidl_next::FromWireRef<crate::wire::LocalUnionPayload<'de>> for LocalUnionPayload { |
| #[inline] |
| fn from_wire_ref(wire: &crate::wire::LocalUnionPayload<'de>) -> Self { |
| match wire.raw.ordinal() { |
| 1 => Self::B(::fidl_next::FromWireRef::from_wire_ref(unsafe { |
| wire.raw.get().deref_unchecked::<bool>() |
| })), |
| |
| ord => return Self::UnknownOrdinal_(ord as u64), |
| } |
| } |
| } |
| |
| impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::LocalUnionPayload<'de>> |
| for LocalUnionPayload |
| { |
| #[inline] |
| fn from_wire_option( |
| wire: crate::wire_optional::LocalUnionPayload<'de>, |
| ) -> ::core::option::Option<Self> { |
| if let Some(inner) = wire.into_option() { |
| Some(::fidl_next::FromWire::from_wire(inner)) |
| } else { |
| None |
| } |
| } |
| } |
| |
| impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::LocalUnionPayload<'de>> |
| for Box<LocalUnionPayload> |
| { |
| #[inline] |
| fn from_wire_option( |
| wire: crate::wire_optional::LocalUnionPayload<'de>, |
| ) -> ::core::option::Option<Self> { |
| <LocalUnionPayload as ::fidl_next::FromWireOption< |
| crate::wire_optional::LocalUnionPayload<'de>, |
| >>::from_wire_option(wire) |
| .map(Box::new) |
| } |
| } |
| |
| impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::LocalUnionPayload<'de>> |
| for Box<LocalUnionPayload> |
| { |
| #[inline] |
| fn from_wire_option_ref( |
| wire: &crate::wire_optional::LocalUnionPayload<'de>, |
| ) -> ::core::option::Option<Self> { |
| if let Some(inner) = wire.as_ref() { |
| Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner))) |
| } else { |
| None |
| } |
| } |
| } |
| |
| #[derive(PartialEq, Clone, Debug, Default)] |
| pub struct MainProtocolOneWayAnonRequest { |
| pub a: ::core::option::Option<u16>, |
| } |
| |
| impl MainProtocolOneWayAnonRequest { |
| fn __max_ordinal(&self) -> usize { |
| if self.a.is_some() { |
| return 1; |
| } |
| |
| 0 |
| } |
| } |
| |
| unsafe impl<___E> ::fidl_next::Encode<crate::wire::MainProtocolOneWayAnonRequest<'static>, ___E> |
| for MainProtocolOneWayAnonRequest |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| { |
| #[inline] |
| fn encode( |
| mut self, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit<crate::wire::MainProtocolOneWayAnonRequest<'static>>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge!(let crate::wire::MainProtocolOneWayAnonRequest { 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 { |
| 1 => { |
| if let Some(value) = self.a.take() { |
| ::fidl_next::WireEnvelope::encode_value::<::fidl_next::WireU16, ___E>( |
| value, |
| preallocated.encoder, |
| &mut out, |
| (), |
| )?; |
| } else { |
| ::fidl_next::WireEnvelope::encode_zero(&mut out) |
| } |
| } |
| |
| _ => ::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::MainProtocolOneWayAnonRequest<'static>, ___E> |
| for &'a MainProtocolOneWayAnonRequest |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit<crate::wire::MainProtocolOneWayAnonRequest<'static>>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge!(let crate::wire::MainProtocolOneWayAnonRequest { 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 { |
| 1 => { |
| if let Some(value) = &self.a { |
| ::fidl_next::WireEnvelope::encode_value::<::fidl_next::WireU16, ___E>( |
| value, |
| preallocated.encoder, |
| &mut out, |
| (), |
| )?; |
| } else { |
| ::fidl_next::WireEnvelope::encode_zero(&mut out) |
| } |
| } |
| |
| _ => ::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::MainProtocolOneWayAnonRequest<'de>> |
| for MainProtocolOneWayAnonRequest |
| { |
| #[inline] |
| fn from_wire(wire_: crate::wire::MainProtocolOneWayAnonRequest<'de>) -> Self { |
| let wire_ = ::core::mem::ManuallyDrop::new(wire_); |
| |
| let a = wire_.table.get(1); |
| |
| Self { |
| a: a.map(|envelope| { |
| ::fidl_next::FromWire::from_wire(unsafe { |
| envelope.read_unchecked::<::fidl_next::WireU16>() |
| }) |
| }), |
| } |
| } |
| } |
| |
| impl<'de> ::fidl_next::FromWireRef<crate::wire::MainProtocolOneWayAnonRequest<'de>> |
| for MainProtocolOneWayAnonRequest |
| { |
| #[inline] |
| fn from_wire_ref(wire: &crate::wire::MainProtocolOneWayAnonRequest<'de>) -> Self { |
| Self { |
| a: wire.table.get(1).map(|envelope| { |
| ::fidl_next::FromWireRef::from_wire_ref(unsafe { |
| envelope.deref_unchecked::<::fidl_next::WireU16>() |
| }) |
| }), |
| } |
| } |
| } |
| |
| #[derive(PartialEq, Clone, Debug)] |
| pub enum MainProtocolTwoWayAnonRequest { |
| B(bool), |
| |
| UnknownOrdinal_(u64), |
| } |
| |
| impl MainProtocolTwoWayAnonRequest { |
| pub fn is_unknown(&self) -> bool { |
| #[allow(unreachable_patterns)] |
| match self { |
| Self::UnknownOrdinal_(_) => true, |
| _ => false, |
| } |
| } |
| } |
| |
| unsafe impl<___E> ::fidl_next::Encode<crate::wire::MainProtocolTwoWayAnonRequest<'static>, ___E> |
| for MainProtocolTwoWayAnonRequest |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| ___E: ::fidl_next::Encoder, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit<crate::wire::MainProtocolTwoWayAnonRequest<'static>>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge!(let crate::wire::MainProtocolTwoWayAnonRequest { raw, _phantom: _ } = out); |
| |
| match self { |
| Self::B(value) => { |
| ::fidl_next::RawWireUnion::encode_as::<___E, bool>(value, 1, encoder, raw, ())? |
| } |
| |
| Self::UnknownOrdinal_(ordinal) => { |
| return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize)); |
| } |
| } |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<'a, ___E> |
| ::fidl_next::Encode<crate::wire::MainProtocolTwoWayAnonRequest<'static>, ___E> |
| for &'a MainProtocolTwoWayAnonRequest |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| ___E: ::fidl_next::Encoder, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit<crate::wire::MainProtocolTwoWayAnonRequest<'static>>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge!(let crate::wire::MainProtocolTwoWayAnonRequest { raw, _phantom: _ } = out); |
| |
| match self { |
| MainProtocolTwoWayAnonRequest::B(value) => { |
| ::fidl_next::RawWireUnion::encode_as::<___E, bool>(value, 1, encoder, raw, ())? |
| } |
| |
| MainProtocolTwoWayAnonRequest::UnknownOrdinal_(ordinal) => { |
| return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize)); |
| } |
| } |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<___E> |
| ::fidl_next::EncodeOption< |
| crate::wire_optional::MainProtocolTwoWayAnonRequest<'static>, |
| ___E, |
| > for MainProtocolTwoWayAnonRequest |
| where |
| ___E: ?Sized, |
| MainProtocolTwoWayAnonRequest: |
| ::fidl_next::Encode<crate::wire::MainProtocolTwoWayAnonRequest<'static>, ___E>, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit< |
| crate::wire_optional::MainProtocolTwoWayAnonRequest<'static>, |
| >, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge!(let crate::wire_optional::MainProtocolTwoWayAnonRequest { 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::MainProtocolTwoWayAnonRequest<'static>, |
| ___E, |
| > for &'a MainProtocolTwoWayAnonRequest |
| where |
| ___E: ?Sized, |
| &'a MainProtocolTwoWayAnonRequest: |
| ::fidl_next::Encode<crate::wire::MainProtocolTwoWayAnonRequest<'static>, ___E>, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit< |
| crate::wire_optional::MainProtocolTwoWayAnonRequest<'static>, |
| >, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge!(let crate::wire_optional::MainProtocolTwoWayAnonRequest { 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<'de> ::fidl_next::FromWire<crate::wire::MainProtocolTwoWayAnonRequest<'de>> |
| for MainProtocolTwoWayAnonRequest |
| { |
| #[inline] |
| fn from_wire(wire: crate::wire::MainProtocolTwoWayAnonRequest<'de>) -> Self { |
| let wire = ::core::mem::ManuallyDrop::new(wire); |
| match wire.raw.ordinal() { |
| 1 => Self::B(::fidl_next::FromWire::from_wire(unsafe { |
| wire.raw.get().read_unchecked::<bool>() |
| })), |
| |
| ord => return Self::UnknownOrdinal_(ord as u64), |
| } |
| } |
| } |
| |
| impl<'de> ::fidl_next::FromWireRef<crate::wire::MainProtocolTwoWayAnonRequest<'de>> |
| for MainProtocolTwoWayAnonRequest |
| { |
| #[inline] |
| fn from_wire_ref(wire: &crate::wire::MainProtocolTwoWayAnonRequest<'de>) -> Self { |
| match wire.raw.ordinal() { |
| 1 => Self::B(::fidl_next::FromWireRef::from_wire_ref(unsafe { |
| wire.raw.get().deref_unchecked::<bool>() |
| })), |
| |
| ord => return Self::UnknownOrdinal_(ord as u64), |
| } |
| } |
| } |
| |
| impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::MainProtocolTwoWayAnonRequest<'de>> |
| for MainProtocolTwoWayAnonRequest |
| { |
| #[inline] |
| fn from_wire_option( |
| wire: crate::wire_optional::MainProtocolTwoWayAnonRequest<'de>, |
| ) -> ::core::option::Option<Self> { |
| if let Some(inner) = wire.into_option() { |
| Some(::fidl_next::FromWire::from_wire(inner)) |
| } else { |
| None |
| } |
| } |
| } |
| |
| impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::MainProtocolTwoWayAnonRequest<'de>> |
| for Box<MainProtocolTwoWayAnonRequest> |
| { |
| #[inline] |
| fn from_wire_option( |
| wire: crate::wire_optional::MainProtocolTwoWayAnonRequest<'de>, |
| ) -> ::core::option::Option<Self> { |
| <MainProtocolTwoWayAnonRequest as ::fidl_next::FromWireOption< |
| crate::wire_optional::MainProtocolTwoWayAnonRequest<'de>, |
| >>::from_wire_option(wire) |
| .map(Box::new) |
| } |
| } |
| |
| impl<'de> |
| ::fidl_next::FromWireOptionRef<crate::wire_optional::MainProtocolTwoWayAnonRequest<'de>> |
| for Box<MainProtocolTwoWayAnonRequest> |
| { |
| #[inline] |
| fn from_wire_option_ref( |
| wire: &crate::wire_optional::MainProtocolTwoWayAnonRequest<'de>, |
| ) -> ::core::option::Option<Self> { |
| if let Some(inner) = wire.as_ref() { |
| Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner))) |
| } else { |
| None |
| } |
| } |
| } |
| |
| #[derive(PartialEq, Clone, Debug, Default)] |
| pub struct MainProtocolTwoWayAnonResponse { |
| pub a: ::core::option::Option<u16>, |
| } |
| |
| impl MainProtocolTwoWayAnonResponse { |
| fn __max_ordinal(&self) -> usize { |
| if self.a.is_some() { |
| return 1; |
| } |
| |
| 0 |
| } |
| } |
| |
| unsafe impl<___E> |
| ::fidl_next::Encode<crate::wire::MainProtocolTwoWayAnonResponse<'static>, ___E> |
| for MainProtocolTwoWayAnonResponse |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| { |
| #[inline] |
| fn encode( |
| mut self, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit< |
| crate::wire::MainProtocolTwoWayAnonResponse<'static>, |
| >, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge!(let crate::wire::MainProtocolTwoWayAnonResponse { 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 { |
| 1 => { |
| if let Some(value) = self.a.take() { |
| ::fidl_next::WireEnvelope::encode_value::<::fidl_next::WireU16, ___E>( |
| value, |
| preallocated.encoder, |
| &mut out, |
| (), |
| )?; |
| } else { |
| ::fidl_next::WireEnvelope::encode_zero(&mut out) |
| } |
| } |
| |
| _ => ::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::MainProtocolTwoWayAnonResponse<'static>, ___E> |
| for &'a MainProtocolTwoWayAnonResponse |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit< |
| crate::wire::MainProtocolTwoWayAnonResponse<'static>, |
| >, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge!(let crate::wire::MainProtocolTwoWayAnonResponse { 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 { |
| 1 => { |
| if let Some(value) = &self.a { |
| ::fidl_next::WireEnvelope::encode_value::<::fidl_next::WireU16, ___E>( |
| value, |
| preallocated.encoder, |
| &mut out, |
| (), |
| )?; |
| } else { |
| ::fidl_next::WireEnvelope::encode_zero(&mut out) |
| } |
| } |
| |
| _ => ::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::MainProtocolTwoWayAnonResponse<'de>> |
| for MainProtocolTwoWayAnonResponse |
| { |
| #[inline] |
| fn from_wire(wire_: crate::wire::MainProtocolTwoWayAnonResponse<'de>) -> Self { |
| let wire_ = ::core::mem::ManuallyDrop::new(wire_); |
| |
| let a = wire_.table.get(1); |
| |
| Self { |
| a: a.map(|envelope| { |
| ::fidl_next::FromWire::from_wire(unsafe { |
| envelope.read_unchecked::<::fidl_next::WireU16>() |
| }) |
| }), |
| } |
| } |
| } |
| |
| impl<'de> ::fidl_next::FromWireRef<crate::wire::MainProtocolTwoWayAnonResponse<'de>> |
| for MainProtocolTwoWayAnonResponse |
| { |
| #[inline] |
| fn from_wire_ref(wire: &crate::wire::MainProtocolTwoWayAnonResponse<'de>) -> Self { |
| Self { |
| a: wire.table.get(1).map(|envelope| { |
| ::fidl_next::FromWireRef::from_wire_ref(unsafe { |
| envelope.deref_unchecked::<::fidl_next::WireU16>() |
| }) |
| }), |
| } |
| } |
| } |
| |
| #[derive(PartialEq, Clone, Debug, Default)] |
| pub struct MainProtocolTwoWayAnonWithErrorRequest { |
| pub a: ::core::option::Option<u16>, |
| } |
| |
| impl MainProtocolTwoWayAnonWithErrorRequest { |
| fn __max_ordinal(&self) -> usize { |
| if self.a.is_some() { |
| return 1; |
| } |
| |
| 0 |
| } |
| } |
| |
| unsafe impl<___E> |
| ::fidl_next::Encode<crate::wire::MainProtocolTwoWayAnonWithErrorRequest<'static>, ___E> |
| for MainProtocolTwoWayAnonWithErrorRequest |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| { |
| #[inline] |
| fn encode( |
| mut self, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit< |
| crate::wire::MainProtocolTwoWayAnonWithErrorRequest<'static>, |
| >, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge!(let crate::wire::MainProtocolTwoWayAnonWithErrorRequest { 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 { |
| 1 => { |
| if let Some(value) = self.a.take() { |
| ::fidl_next::WireEnvelope::encode_value::<::fidl_next::WireU16, ___E>( |
| value, |
| preallocated.encoder, |
| &mut out, |
| (), |
| )?; |
| } else { |
| ::fidl_next::WireEnvelope::encode_zero(&mut out) |
| } |
| } |
| |
| _ => ::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::MainProtocolTwoWayAnonWithErrorRequest<'static>, ___E> |
| for &'a MainProtocolTwoWayAnonWithErrorRequest |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit< |
| crate::wire::MainProtocolTwoWayAnonWithErrorRequest<'static>, |
| >, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge!(let crate::wire::MainProtocolTwoWayAnonWithErrorRequest { 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 { |
| 1 => { |
| if let Some(value) = &self.a { |
| ::fidl_next::WireEnvelope::encode_value::<::fidl_next::WireU16, ___E>( |
| value, |
| preallocated.encoder, |
| &mut out, |
| (), |
| )?; |
| } else { |
| ::fidl_next::WireEnvelope::encode_zero(&mut out) |
| } |
| } |
| |
| _ => ::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::MainProtocolTwoWayAnonWithErrorRequest<'de>> |
| for MainProtocolTwoWayAnonWithErrorRequest |
| { |
| #[inline] |
| fn from_wire(wire_: crate::wire::MainProtocolTwoWayAnonWithErrorRequest<'de>) -> Self { |
| let wire_ = ::core::mem::ManuallyDrop::new(wire_); |
| |
| let a = wire_.table.get(1); |
| |
| Self { |
| a: a.map(|envelope| { |
| ::fidl_next::FromWire::from_wire(unsafe { |
| envelope.read_unchecked::<::fidl_next::WireU16>() |
| }) |
| }), |
| } |
| } |
| } |
| |
| impl<'de> ::fidl_next::FromWireRef<crate::wire::MainProtocolTwoWayAnonWithErrorRequest<'de>> |
| for MainProtocolTwoWayAnonWithErrorRequest |
| { |
| #[inline] |
| fn from_wire_ref(wire: &crate::wire::MainProtocolTwoWayAnonWithErrorRequest<'de>) -> Self { |
| Self { |
| a: wire.table.get(1).map(|envelope| { |
| ::fidl_next::FromWireRef::from_wire_ref(unsafe { |
| envelope.deref_unchecked::<::fidl_next::WireU16>() |
| }) |
| }), |
| } |
| } |
| } |
| |
| #[derive(PartialEq, Clone, Debug)] |
| pub enum MainProtocolTwoWayAnonWithErrorResponse { |
| B(bool), |
| |
| UnknownOrdinal_(u64), |
| } |
| |
| impl MainProtocolTwoWayAnonWithErrorResponse { |
| pub fn is_unknown(&self) -> bool { |
| #[allow(unreachable_patterns)] |
| match self { |
| Self::UnknownOrdinal_(_) => true, |
| _ => false, |
| } |
| } |
| } |
| |
| unsafe impl<___E> |
| ::fidl_next::Encode<crate::wire::MainProtocolTwoWayAnonWithErrorResponse<'static>, ___E> |
| for MainProtocolTwoWayAnonWithErrorResponse |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| ___E: ::fidl_next::Encoder, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit< |
| crate::wire::MainProtocolTwoWayAnonWithErrorResponse<'static>, |
| >, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge!(let crate::wire::MainProtocolTwoWayAnonWithErrorResponse { raw, _phantom: _ } = out); |
| |
| match self { |
| Self::B(value) => { |
| ::fidl_next::RawWireUnion::encode_as::<___E, bool>(value, 1, encoder, raw, ())? |
| } |
| |
| Self::UnknownOrdinal_(ordinal) => { |
| return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize)); |
| } |
| } |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<'a, ___E> |
| ::fidl_next::Encode<crate::wire::MainProtocolTwoWayAnonWithErrorResponse<'static>, ___E> |
| for &'a MainProtocolTwoWayAnonWithErrorResponse |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| ___E: ::fidl_next::Encoder, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit< |
| crate::wire::MainProtocolTwoWayAnonWithErrorResponse<'static>, |
| >, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge!(let crate::wire::MainProtocolTwoWayAnonWithErrorResponse { raw, _phantom: _ } = out); |
| |
| match self { |
| MainProtocolTwoWayAnonWithErrorResponse::B(value) => { |
| ::fidl_next::RawWireUnion::encode_as::<___E, bool>(value, 1, encoder, raw, ())? |
| } |
| |
| MainProtocolTwoWayAnonWithErrorResponse::UnknownOrdinal_(ordinal) => { |
| return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize)); |
| } |
| } |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<___E> |
| ::fidl_next::EncodeOption< |
| crate::wire_optional::MainProtocolTwoWayAnonWithErrorResponse<'static>, |
| ___E, |
| > for MainProtocolTwoWayAnonWithErrorResponse |
| where |
| ___E: ?Sized, |
| MainProtocolTwoWayAnonWithErrorResponse: ::fidl_next::Encode<crate::wire::MainProtocolTwoWayAnonWithErrorResponse<'static>, ___E>, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit< |
| crate::wire_optional::MainProtocolTwoWayAnonWithErrorResponse<'static>, |
| >, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge!(let crate::wire_optional::MainProtocolTwoWayAnonWithErrorResponse { 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::MainProtocolTwoWayAnonWithErrorResponse<'static>, |
| ___E, |
| > for &'a MainProtocolTwoWayAnonWithErrorResponse |
| where |
| ___E: ?Sized, |
| &'a MainProtocolTwoWayAnonWithErrorResponse: ::fidl_next::Encode<crate::wire::MainProtocolTwoWayAnonWithErrorResponse<'static>, ___E>, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit< |
| crate::wire_optional::MainProtocolTwoWayAnonWithErrorResponse<'static>, |
| >, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge!(let crate::wire_optional::MainProtocolTwoWayAnonWithErrorResponse { 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<'de> ::fidl_next::FromWire<crate::wire::MainProtocolTwoWayAnonWithErrorResponse<'de>> |
| for MainProtocolTwoWayAnonWithErrorResponse |
| { |
| #[inline] |
| fn from_wire(wire: crate::wire::MainProtocolTwoWayAnonWithErrorResponse<'de>) -> Self { |
| let wire = ::core::mem::ManuallyDrop::new(wire); |
| match wire.raw.ordinal() { |
| 1 => Self::B(::fidl_next::FromWire::from_wire(unsafe { |
| wire.raw.get().read_unchecked::<bool>() |
| })), |
| |
| ord => return Self::UnknownOrdinal_(ord as u64), |
| } |
| } |
| } |
| |
| impl<'de> ::fidl_next::FromWireRef<crate::wire::MainProtocolTwoWayAnonWithErrorResponse<'de>> |
| for MainProtocolTwoWayAnonWithErrorResponse |
| { |
| #[inline] |
| fn from_wire_ref(wire: &crate::wire::MainProtocolTwoWayAnonWithErrorResponse<'de>) -> Self { |
| match wire.raw.ordinal() { |
| 1 => Self::B(::fidl_next::FromWireRef::from_wire_ref(unsafe { |
| wire.raw.get().deref_unchecked::<bool>() |
| })), |
| |
| ord => return Self::UnknownOrdinal_(ord as u64), |
| } |
| } |
| } |
| |
| impl<'de> |
| ::fidl_next::FromWireOption< |
| crate::wire_optional::MainProtocolTwoWayAnonWithErrorResponse<'de>, |
| > for MainProtocolTwoWayAnonWithErrorResponse |
| { |
| #[inline] |
| fn from_wire_option( |
| wire: crate::wire_optional::MainProtocolTwoWayAnonWithErrorResponse<'de>, |
| ) -> ::core::option::Option<Self> { |
| if let Some(inner) = wire.into_option() { |
| Some(::fidl_next::FromWire::from_wire(inner)) |
| } else { |
| None |
| } |
| } |
| } |
| |
| impl<'de> |
| ::fidl_next::FromWireOption< |
| crate::wire_optional::MainProtocolTwoWayAnonWithErrorResponse<'de>, |
| > for Box<MainProtocolTwoWayAnonWithErrorResponse> |
| { |
| #[inline] |
| fn from_wire_option( |
| wire: crate::wire_optional::MainProtocolTwoWayAnonWithErrorResponse<'de>, |
| ) -> ::core::option::Option<Self> { |
| <MainProtocolTwoWayAnonWithErrorResponse as ::fidl_next::FromWireOption< |
| crate::wire_optional::MainProtocolTwoWayAnonWithErrorResponse<'de>, |
| >>::from_wire_option(wire) |
| .map(Box::new) |
| } |
| } |
| |
| impl<'de> |
| ::fidl_next::FromWireOptionRef< |
| crate::wire_optional::MainProtocolTwoWayAnonWithErrorResponse<'de>, |
| > for Box<MainProtocolTwoWayAnonWithErrorResponse> |
| { |
| #[inline] |
| fn from_wire_option_ref( |
| wire: &crate::wire_optional::MainProtocolTwoWayAnonWithErrorResponse<'de>, |
| ) -> ::core::option::Option<Self> { |
| if let Some(inner) = wire.as_ref() { |
| Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner))) |
| } else { |
| None |
| } |
| } |
| } |
| |
| #[derive(PartialEq, Clone, Debug)] |
| pub enum MainProtocolOnAnonRequest { |
| B(bool), |
| |
| UnknownOrdinal_(u64), |
| } |
| |
| impl MainProtocolOnAnonRequest { |
| pub fn is_unknown(&self) -> bool { |
| #[allow(unreachable_patterns)] |
| match self { |
| Self::UnknownOrdinal_(_) => true, |
| _ => false, |
| } |
| } |
| } |
| |
| unsafe impl<___E> ::fidl_next::Encode<crate::wire::MainProtocolOnAnonRequest<'static>, ___E> |
| for MainProtocolOnAnonRequest |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| ___E: ::fidl_next::Encoder, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit<crate::wire::MainProtocolOnAnonRequest<'static>>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge!(let crate::wire::MainProtocolOnAnonRequest { raw, _phantom: _ } = out); |
| |
| match self { |
| Self::B(value) => { |
| ::fidl_next::RawWireUnion::encode_as::<___E, bool>(value, 1, encoder, raw, ())? |
| } |
| |
| Self::UnknownOrdinal_(ordinal) => { |
| return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize)); |
| } |
| } |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::MainProtocolOnAnonRequest<'static>, ___E> |
| for &'a MainProtocolOnAnonRequest |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| ___E: ::fidl_next::Encoder, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit<crate::wire::MainProtocolOnAnonRequest<'static>>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge!(let crate::wire::MainProtocolOnAnonRequest { raw, _phantom: _ } = out); |
| |
| match self { |
| MainProtocolOnAnonRequest::B(value) => { |
| ::fidl_next::RawWireUnion::encode_as::<___E, bool>(value, 1, encoder, raw, ())? |
| } |
| |
| MainProtocolOnAnonRequest::UnknownOrdinal_(ordinal) => { |
| return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize)); |
| } |
| } |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<___E> |
| ::fidl_next::EncodeOption<crate::wire_optional::MainProtocolOnAnonRequest<'static>, ___E> |
| for MainProtocolOnAnonRequest |
| where |
| ___E: ?Sized, |
| MainProtocolOnAnonRequest: |
| ::fidl_next::Encode<crate::wire::MainProtocolOnAnonRequest<'static>, ___E>, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit< |
| crate::wire_optional::MainProtocolOnAnonRequest<'static>, |
| >, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge!(let crate::wire_optional::MainProtocolOnAnonRequest { 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::MainProtocolOnAnonRequest<'static>, ___E> |
| for &'a MainProtocolOnAnonRequest |
| where |
| ___E: ?Sized, |
| &'a MainProtocolOnAnonRequest: |
| ::fidl_next::Encode<crate::wire::MainProtocolOnAnonRequest<'static>, ___E>, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit< |
| crate::wire_optional::MainProtocolOnAnonRequest<'static>, |
| >, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge!(let crate::wire_optional::MainProtocolOnAnonRequest { 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<'de> ::fidl_next::FromWire<crate::wire::MainProtocolOnAnonRequest<'de>> |
| for MainProtocolOnAnonRequest |
| { |
| #[inline] |
| fn from_wire(wire: crate::wire::MainProtocolOnAnonRequest<'de>) -> Self { |
| let wire = ::core::mem::ManuallyDrop::new(wire); |
| match wire.raw.ordinal() { |
| 1 => Self::B(::fidl_next::FromWire::from_wire(unsafe { |
| wire.raw.get().read_unchecked::<bool>() |
| })), |
| |
| ord => return Self::UnknownOrdinal_(ord as u64), |
| } |
| } |
| } |
| |
| impl<'de> ::fidl_next::FromWireRef<crate::wire::MainProtocolOnAnonRequest<'de>> |
| for MainProtocolOnAnonRequest |
| { |
| #[inline] |
| fn from_wire_ref(wire: &crate::wire::MainProtocolOnAnonRequest<'de>) -> Self { |
| match wire.raw.ordinal() { |
| 1 => Self::B(::fidl_next::FromWireRef::from_wire_ref(unsafe { |
| wire.raw.get().deref_unchecked::<bool>() |
| })), |
| |
| ord => return Self::UnknownOrdinal_(ord as u64), |
| } |
| } |
| } |
| |
| impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::MainProtocolOnAnonRequest<'de>> |
| for MainProtocolOnAnonRequest |
| { |
| #[inline] |
| fn from_wire_option( |
| wire: crate::wire_optional::MainProtocolOnAnonRequest<'de>, |
| ) -> ::core::option::Option<Self> { |
| if let Some(inner) = wire.into_option() { |
| Some(::fidl_next::FromWire::from_wire(inner)) |
| } else { |
| None |
| } |
| } |
| } |
| |
| impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::MainProtocolOnAnonRequest<'de>> |
| for Box<MainProtocolOnAnonRequest> |
| { |
| #[inline] |
| fn from_wire_option( |
| wire: crate::wire_optional::MainProtocolOnAnonRequest<'de>, |
| ) -> ::core::option::Option<Self> { |
| <MainProtocolOnAnonRequest as ::fidl_next::FromWireOption< |
| crate::wire_optional::MainProtocolOnAnonRequest<'de>, |
| >>::from_wire_option(wire) |
| .map(Box::new) |
| } |
| } |
| |
| impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::MainProtocolOnAnonRequest<'de>> |
| for Box<MainProtocolOnAnonRequest> |
| { |
| #[inline] |
| fn from_wire_option_ref( |
| wire: &crate::wire_optional::MainProtocolOnAnonRequest<'de>, |
| ) -> ::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 [`LocalTablePayload`]. |
| #[repr(C)] |
| pub struct LocalTablePayload<'de> { |
| pub(crate) table: ::fidl_next::WireTable<'de>, |
| } |
| |
| impl<'de> Drop for LocalTablePayload<'de> { |
| fn drop(&mut self) { |
| let _ = self |
| .table |
| .get(1) |
| .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU16>() }); |
| } |
| } |
| |
| unsafe impl ::fidl_next::Wire for LocalTablePayload<'static> { |
| type Owned<'de> = LocalTablePayload<'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 LocalTablePayload<'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() }, |
| |
| 1 => { |
| ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU16>( |
| slot.as_mut(), |
| decoder, |
| (), |
| )?; |
| |
| Ok(()) |
| } |
| |
| _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder), |
| } |
| }) |
| } |
| } |
| |
| impl<'de> LocalTablePayload<'de> { |
| pub fn a(&self) -> ::core::option::Option<&::fidl_next::WireU16> { |
| unsafe { Some(self.table.get(1)?.deref_unchecked()) } |
| } |
| } |
| |
| impl<'de> ::core::fmt::Debug for LocalTablePayload<'de> { |
| fn fmt( |
| &self, |
| f: &mut ::core::fmt::Formatter<'_>, |
| ) -> ::core::result::Result<(), ::core::fmt::Error> { |
| f.debug_struct("LocalTablePayload").field("a", &self.a()).finish() |
| } |
| } |
| |
| impl<'de> ::fidl_next::IntoNatural for LocalTablePayload<'de> { |
| type Natural = crate::natural::LocalTablePayload; |
| } |
| |
| impl ::fidl_next::Unconstrained for LocalTablePayload<'_> {} |
| |
| /// The wire type corresponding to [`LocalUnionPayload`]. |
| #[repr(transparent)] |
| pub struct LocalUnionPayload<'de> { |
| pub(crate) raw: ::fidl_next::RawWireUnion, |
| pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>, |
| } |
| |
| impl<'de> Drop for LocalUnionPayload<'de> { |
| fn drop(&mut self) { |
| match self.raw.ordinal() { |
| 1 => { |
| let _ = unsafe { self.raw.get().read_unchecked::<bool>() }; |
| } |
| |
| _ => (), |
| } |
| } |
| } |
| |
| unsafe impl ::fidl_next::Wire for LocalUnionPayload<'static> { |
| type Owned<'de> = LocalUnionPayload<'de>; |
| |
| #[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 local_union_payload { |
| pub enum Ref<'de> { |
| B(&'de bool), |
| |
| UnknownOrdinal_(u64), |
| } |
| } |
| |
| impl<'de> LocalUnionPayload<'de> { |
| pub fn as_ref(&self) -> crate::wire::local_union_payload::Ref<'_> { |
| match self.raw.ordinal() { |
| 1 => crate::wire::local_union_payload::Ref::B(unsafe { |
| self.raw.get().deref_unchecked::<bool>() |
| }), |
| |
| unknown => crate::wire::local_union_payload::Ref::UnknownOrdinal_(unknown), |
| } |
| } |
| } |
| |
| unsafe impl<___D> ::fidl_next::Decode<___D> for LocalUnionPayload<'static> |
| where |
| ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized, |
| ___D: ::fidl_next::Decoder, |
| { |
| 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::<___D, bool>(raw, decoder, ())?, |
| |
| _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?, |
| } |
| |
| Ok(()) |
| } |
| } |
| |
| impl<'de> ::core::fmt::Debug for LocalUnionPayload<'de> { |
| 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<'de> ::fidl_next::IntoNatural for LocalUnionPayload<'de> { |
| type Natural = crate::natural::LocalUnionPayload; |
| } |
| |
| impl ::fidl_next::Unconstrained for LocalUnionPayload<'static> {} |
| |
| /// The wire type corresponding to [`MainProtocolOneWayAnonRequest`]. |
| #[repr(C)] |
| pub struct MainProtocolOneWayAnonRequest<'de> { |
| pub(crate) table: ::fidl_next::WireTable<'de>, |
| } |
| |
| impl<'de> Drop for MainProtocolOneWayAnonRequest<'de> { |
| fn drop(&mut self) { |
| let _ = self |
| .table |
| .get(1) |
| .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU16>() }); |
| } |
| } |
| |
| unsafe impl ::fidl_next::Wire for MainProtocolOneWayAnonRequest<'static> { |
| type Owned<'de> = MainProtocolOneWayAnonRequest<'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 MainProtocolOneWayAnonRequest<'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() }, |
| |
| 1 => { |
| ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU16>( |
| slot.as_mut(), |
| decoder, |
| (), |
| )?; |
| |
| Ok(()) |
| } |
| |
| _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder), |
| } |
| }) |
| } |
| } |
| |
| impl<'de> MainProtocolOneWayAnonRequest<'de> { |
| pub fn a(&self) -> ::core::option::Option<&::fidl_next::WireU16> { |
| unsafe { Some(self.table.get(1)?.deref_unchecked()) } |
| } |
| } |
| |
| impl<'de> ::core::fmt::Debug for MainProtocolOneWayAnonRequest<'de> { |
| fn fmt( |
| &self, |
| f: &mut ::core::fmt::Formatter<'_>, |
| ) -> ::core::result::Result<(), ::core::fmt::Error> { |
| f.debug_struct("MainProtocolOneWayAnonRequest").field("a", &self.a()).finish() |
| } |
| } |
| |
| impl<'de> ::fidl_next::IntoNatural for MainProtocolOneWayAnonRequest<'de> { |
| type Natural = crate::natural::MainProtocolOneWayAnonRequest; |
| } |
| |
| impl ::fidl_next::Unconstrained for MainProtocolOneWayAnonRequest<'_> {} |
| |
| /// The wire type corresponding to [`MainProtocolTwoWayAnonRequest`]. |
| #[repr(transparent)] |
| pub struct MainProtocolTwoWayAnonRequest<'de> { |
| pub(crate) raw: ::fidl_next::RawWireUnion, |
| pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>, |
| } |
| |
| impl<'de> Drop for MainProtocolTwoWayAnonRequest<'de> { |
| fn drop(&mut self) { |
| match self.raw.ordinal() { |
| 1 => { |
| let _ = unsafe { self.raw.get().read_unchecked::<bool>() }; |
| } |
| |
| _ => (), |
| } |
| } |
| } |
| |
| unsafe impl ::fidl_next::Wire for MainProtocolTwoWayAnonRequest<'static> { |
| type Owned<'de> = MainProtocolTwoWayAnonRequest<'de>; |
| |
| #[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 main_protocol_two_way_anon_request { |
| pub enum Ref<'de> { |
| B(&'de bool), |
| |
| UnknownOrdinal_(u64), |
| } |
| } |
| |
| impl<'de> MainProtocolTwoWayAnonRequest<'de> { |
| pub fn as_ref(&self) -> crate::wire::main_protocol_two_way_anon_request::Ref<'_> { |
| match self.raw.ordinal() { |
| 1 => crate::wire::main_protocol_two_way_anon_request::Ref::B(unsafe { |
| self.raw.get().deref_unchecked::<bool>() |
| }), |
| |
| unknown => { |
| crate::wire::main_protocol_two_way_anon_request::Ref::UnknownOrdinal_(unknown) |
| } |
| } |
| } |
| } |
| |
| unsafe impl<___D> ::fidl_next::Decode<___D> for MainProtocolTwoWayAnonRequest<'static> |
| where |
| ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized, |
| ___D: ::fidl_next::Decoder, |
| { |
| 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::<___D, bool>(raw, decoder, ())?, |
| |
| _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?, |
| } |
| |
| Ok(()) |
| } |
| } |
| |
| impl<'de> ::core::fmt::Debug for MainProtocolTwoWayAnonRequest<'de> { |
| 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<'de> ::fidl_next::IntoNatural for MainProtocolTwoWayAnonRequest<'de> { |
| type Natural = crate::natural::MainProtocolTwoWayAnonRequest; |
| } |
| |
| impl ::fidl_next::Unconstrained for MainProtocolTwoWayAnonRequest<'static> {} |
| |
| /// The wire type corresponding to [`MainProtocolTwoWayAnonResponse`]. |
| #[repr(C)] |
| pub struct MainProtocolTwoWayAnonResponse<'de> { |
| pub(crate) table: ::fidl_next::WireTable<'de>, |
| } |
| |
| impl<'de> Drop for MainProtocolTwoWayAnonResponse<'de> { |
| fn drop(&mut self) { |
| let _ = self |
| .table |
| .get(1) |
| .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU16>() }); |
| } |
| } |
| |
| unsafe impl ::fidl_next::Wire for MainProtocolTwoWayAnonResponse<'static> { |
| type Owned<'de> = MainProtocolTwoWayAnonResponse<'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 MainProtocolTwoWayAnonResponse<'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() }, |
| |
| 1 => { |
| ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU16>( |
| slot.as_mut(), |
| decoder, |
| (), |
| )?; |
| |
| Ok(()) |
| } |
| |
| _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder), |
| } |
| }) |
| } |
| } |
| |
| impl<'de> MainProtocolTwoWayAnonResponse<'de> { |
| pub fn a(&self) -> ::core::option::Option<&::fidl_next::WireU16> { |
| unsafe { Some(self.table.get(1)?.deref_unchecked()) } |
| } |
| } |
| |
| impl<'de> ::core::fmt::Debug for MainProtocolTwoWayAnonResponse<'de> { |
| fn fmt( |
| &self, |
| f: &mut ::core::fmt::Formatter<'_>, |
| ) -> ::core::result::Result<(), ::core::fmt::Error> { |
| f.debug_struct("MainProtocolTwoWayAnonResponse").field("a", &self.a()).finish() |
| } |
| } |
| |
| impl<'de> ::fidl_next::IntoNatural for MainProtocolTwoWayAnonResponse<'de> { |
| type Natural = crate::natural::MainProtocolTwoWayAnonResponse; |
| } |
| |
| impl ::fidl_next::Unconstrained for MainProtocolTwoWayAnonResponse<'_> {} |
| |
| /// The wire type corresponding to [`MainProtocolTwoWayAnonWithErrorRequest`]. |
| #[repr(C)] |
| pub struct MainProtocolTwoWayAnonWithErrorRequest<'de> { |
| pub(crate) table: ::fidl_next::WireTable<'de>, |
| } |
| |
| impl<'de> Drop for MainProtocolTwoWayAnonWithErrorRequest<'de> { |
| fn drop(&mut self) { |
| let _ = self |
| .table |
| .get(1) |
| .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU16>() }); |
| } |
| } |
| |
| unsafe impl ::fidl_next::Wire for MainProtocolTwoWayAnonWithErrorRequest<'static> { |
| type Owned<'de> = MainProtocolTwoWayAnonWithErrorRequest<'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 MainProtocolTwoWayAnonWithErrorRequest<'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() }, |
| |
| 1 => { |
| ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU16>( |
| slot.as_mut(), |
| decoder, |
| (), |
| )?; |
| |
| Ok(()) |
| } |
| |
| _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder), |
| } |
| }) |
| } |
| } |
| |
| impl<'de> MainProtocolTwoWayAnonWithErrorRequest<'de> { |
| pub fn a(&self) -> ::core::option::Option<&::fidl_next::WireU16> { |
| unsafe { Some(self.table.get(1)?.deref_unchecked()) } |
| } |
| } |
| |
| impl<'de> ::core::fmt::Debug for MainProtocolTwoWayAnonWithErrorRequest<'de> { |
| fn fmt( |
| &self, |
| f: &mut ::core::fmt::Formatter<'_>, |
| ) -> ::core::result::Result<(), ::core::fmt::Error> { |
| f.debug_struct("MainProtocolTwoWayAnonWithErrorRequest").field("a", &self.a()).finish() |
| } |
| } |
| |
| impl<'de> ::fidl_next::IntoNatural for MainProtocolTwoWayAnonWithErrorRequest<'de> { |
| type Natural = crate::natural::MainProtocolTwoWayAnonWithErrorRequest; |
| } |
| |
| impl ::fidl_next::Unconstrained for MainProtocolTwoWayAnonWithErrorRequest<'_> {} |
| |
| /// The wire type corresponding to [`MainProtocolTwoWayAnonWithErrorResponse`]. |
| #[repr(transparent)] |
| pub struct MainProtocolTwoWayAnonWithErrorResponse<'de> { |
| pub(crate) raw: ::fidl_next::RawWireUnion, |
| pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>, |
| } |
| |
| impl<'de> Drop for MainProtocolTwoWayAnonWithErrorResponse<'de> { |
| fn drop(&mut self) { |
| match self.raw.ordinal() { |
| 1 => { |
| let _ = unsafe { self.raw.get().read_unchecked::<bool>() }; |
| } |
| |
| _ => (), |
| } |
| } |
| } |
| |
| unsafe impl ::fidl_next::Wire for MainProtocolTwoWayAnonWithErrorResponse<'static> { |
| type Owned<'de> = MainProtocolTwoWayAnonWithErrorResponse<'de>; |
| |
| #[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 main_protocol_two_way_anon_with_error_response { |
| pub enum Ref<'de> { |
| B(&'de bool), |
| |
| UnknownOrdinal_(u64), |
| } |
| } |
| |
| impl<'de> MainProtocolTwoWayAnonWithErrorResponse<'de> { |
| pub fn as_ref( |
| &self, |
| ) -> crate::wire::main_protocol_two_way_anon_with_error_response::Ref<'_> { |
| match self.raw.ordinal() { |
| |
| 1 => crate::wire::main_protocol_two_way_anon_with_error_response::Ref::B( |
| unsafe { self.raw.get().deref_unchecked::<bool>() } |
| ), |
| |
| |
| unknown => crate::wire::main_protocol_two_way_anon_with_error_response::Ref::UnknownOrdinal_(unknown), |
| |
| } |
| } |
| } |
| |
| unsafe impl<___D> ::fidl_next::Decode<___D> for MainProtocolTwoWayAnonWithErrorResponse<'static> |
| where |
| ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized, |
| ___D: ::fidl_next::Decoder, |
| { |
| 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::<___D, bool>(raw, decoder, ())?, |
| |
| _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?, |
| } |
| |
| Ok(()) |
| } |
| } |
| |
| impl<'de> ::core::fmt::Debug for MainProtocolTwoWayAnonWithErrorResponse<'de> { |
| 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<'de> ::fidl_next::IntoNatural for MainProtocolTwoWayAnonWithErrorResponse<'de> { |
| type Natural = crate::natural::MainProtocolTwoWayAnonWithErrorResponse; |
| } |
| |
| impl ::fidl_next::Unconstrained for MainProtocolTwoWayAnonWithErrorResponse<'static> {} |
| |
| /// The wire type corresponding to [`MainProtocolOnAnonRequest`]. |
| #[repr(transparent)] |
| pub struct MainProtocolOnAnonRequest<'de> { |
| pub(crate) raw: ::fidl_next::RawWireUnion, |
| pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>, |
| } |
| |
| impl<'de> Drop for MainProtocolOnAnonRequest<'de> { |
| fn drop(&mut self) { |
| match self.raw.ordinal() { |
| 1 => { |
| let _ = unsafe { self.raw.get().read_unchecked::<bool>() }; |
| } |
| |
| _ => (), |
| } |
| } |
| } |
| |
| unsafe impl ::fidl_next::Wire for MainProtocolOnAnonRequest<'static> { |
| type Owned<'de> = MainProtocolOnAnonRequest<'de>; |
| |
| #[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 main_protocol_on_anon_request { |
| pub enum Ref<'de> { |
| B(&'de bool), |
| |
| UnknownOrdinal_(u64), |
| } |
| } |
| |
| impl<'de> MainProtocolOnAnonRequest<'de> { |
| pub fn as_ref(&self) -> crate::wire::main_protocol_on_anon_request::Ref<'_> { |
| match self.raw.ordinal() { |
| 1 => crate::wire::main_protocol_on_anon_request::Ref::B(unsafe { |
| self.raw.get().deref_unchecked::<bool>() |
| }), |
| |
| unknown => { |
| crate::wire::main_protocol_on_anon_request::Ref::UnknownOrdinal_(unknown) |
| } |
| } |
| } |
| } |
| |
| unsafe impl<___D> ::fidl_next::Decode<___D> for MainProtocolOnAnonRequest<'static> |
| where |
| ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized, |
| ___D: ::fidl_next::Decoder, |
| { |
| 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::<___D, bool>(raw, decoder, ())?, |
| |
| _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?, |
| } |
| |
| Ok(()) |
| } |
| } |
| |
| impl<'de> ::core::fmt::Debug for MainProtocolOnAnonRequest<'de> { |
| 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<'de> ::fidl_next::IntoNatural for MainProtocolOnAnonRequest<'de> { |
| type Natural = crate::natural::MainProtocolOnAnonRequest; |
| } |
| |
| impl ::fidl_next::Unconstrained for MainProtocolOnAnonRequest<'static> {} |
| } |
| |
| pub mod wire_optional { |
| |
| #[repr(transparent)] |
| pub struct LocalUnionPayload<'de> { |
| pub(crate) raw: ::fidl_next::RawWireUnion, |
| pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>, |
| } |
| |
| unsafe impl ::fidl_next::Wire for LocalUnionPayload<'static> { |
| type Owned<'de> = LocalUnionPayload<'de>; |
| |
| #[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<'de> LocalUnionPayload<'de> { |
| 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::LocalUnionPayload<'de>> { |
| if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None } |
| } |
| |
| pub fn into_option(self) -> ::core::option::Option<crate::wire::LocalUnionPayload<'de>> { |
| if self.is_some() { |
| Some(crate::wire::LocalUnionPayload { |
| raw: self.raw, |
| _phantom: ::core::marker::PhantomData, |
| }) |
| } else { |
| None |
| } |
| } |
| } |
| |
| unsafe impl<___D> ::fidl_next::Decode<___D> for LocalUnionPayload<'static> |
| where |
| ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized, |
| ___D: ::fidl_next::Decoder, |
| { |
| 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::<___D, bool>(raw, decoder, ())?, |
| |
| 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?, |
| _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?, |
| } |
| |
| Ok(()) |
| } |
| } |
| |
| impl<'de> ::core::fmt::Debug for LocalUnionPayload<'de> { |
| fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { |
| self.as_ref().fmt(f) |
| } |
| } |
| |
| impl<'de> ::fidl_next::IntoNatural for LocalUnionPayload<'de> { |
| type Natural = ::core::option::Option<crate::natural::LocalUnionPayload>; |
| } |
| |
| impl ::fidl_next::Unconstrained for LocalUnionPayload<'static> {} |
| |
| #[repr(transparent)] |
| pub struct MainProtocolTwoWayAnonRequest<'de> { |
| pub(crate) raw: ::fidl_next::RawWireUnion, |
| pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>, |
| } |
| |
| unsafe impl ::fidl_next::Wire for MainProtocolTwoWayAnonRequest<'static> { |
| type Owned<'de> = MainProtocolTwoWayAnonRequest<'de>; |
| |
| #[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<'de> MainProtocolTwoWayAnonRequest<'de> { |
| 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::MainProtocolTwoWayAnonRequest<'de>> { |
| if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None } |
| } |
| |
| pub fn into_option( |
| self, |
| ) -> ::core::option::Option<crate::wire::MainProtocolTwoWayAnonRequest<'de>> { |
| if self.is_some() { |
| Some(crate::wire::MainProtocolTwoWayAnonRequest { |
| raw: self.raw, |
| _phantom: ::core::marker::PhantomData, |
| }) |
| } else { |
| None |
| } |
| } |
| } |
| |
| unsafe impl<___D> ::fidl_next::Decode<___D> for MainProtocolTwoWayAnonRequest<'static> |
| where |
| ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized, |
| ___D: ::fidl_next::Decoder, |
| { |
| 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::<___D, bool>(raw, decoder, ())?, |
| |
| 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?, |
| _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?, |
| } |
| |
| Ok(()) |
| } |
| } |
| |
| impl<'de> ::core::fmt::Debug for MainProtocolTwoWayAnonRequest<'de> { |
| fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { |
| self.as_ref().fmt(f) |
| } |
| } |
| |
| impl<'de> ::fidl_next::IntoNatural for MainProtocolTwoWayAnonRequest<'de> { |
| type Natural = ::core::option::Option<crate::natural::MainProtocolTwoWayAnonRequest>; |
| } |
| |
| impl ::fidl_next::Unconstrained for MainProtocolTwoWayAnonRequest<'static> {} |
| |
| #[repr(transparent)] |
| pub struct MainProtocolTwoWayAnonWithErrorResponse<'de> { |
| pub(crate) raw: ::fidl_next::RawWireUnion, |
| pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>, |
| } |
| |
| unsafe impl ::fidl_next::Wire for MainProtocolTwoWayAnonWithErrorResponse<'static> { |
| type Owned<'de> = MainProtocolTwoWayAnonWithErrorResponse<'de>; |
| |
| #[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<'de> MainProtocolTwoWayAnonWithErrorResponse<'de> { |
| 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::MainProtocolTwoWayAnonWithErrorResponse<'de>> |
| { |
| if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None } |
| } |
| |
| pub fn into_option( |
| self, |
| ) -> ::core::option::Option<crate::wire::MainProtocolTwoWayAnonWithErrorResponse<'de>> |
| { |
| if self.is_some() { |
| Some(crate::wire::MainProtocolTwoWayAnonWithErrorResponse { |
| raw: self.raw, |
| _phantom: ::core::marker::PhantomData, |
| }) |
| } else { |
| None |
| } |
| } |
| } |
| |
| unsafe impl<___D> ::fidl_next::Decode<___D> for MainProtocolTwoWayAnonWithErrorResponse<'static> |
| where |
| ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized, |
| ___D: ::fidl_next::Decoder, |
| { |
| 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::<___D, bool>(raw, decoder, ())?, |
| |
| 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?, |
| _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?, |
| } |
| |
| Ok(()) |
| } |
| } |
| |
| impl<'de> ::core::fmt::Debug for MainProtocolTwoWayAnonWithErrorResponse<'de> { |
| fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { |
| self.as_ref().fmt(f) |
| } |
| } |
| |
| impl<'de> ::fidl_next::IntoNatural for MainProtocolTwoWayAnonWithErrorResponse<'de> { |
| type Natural = |
| ::core::option::Option<crate::natural::MainProtocolTwoWayAnonWithErrorResponse>; |
| } |
| |
| impl ::fidl_next::Unconstrained for MainProtocolTwoWayAnonWithErrorResponse<'static> {} |
| |
| #[repr(transparent)] |
| pub struct MainProtocolOnAnonRequest<'de> { |
| pub(crate) raw: ::fidl_next::RawWireUnion, |
| pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>, |
| } |
| |
| unsafe impl ::fidl_next::Wire for MainProtocolOnAnonRequest<'static> { |
| type Owned<'de> = MainProtocolOnAnonRequest<'de>; |
| |
| #[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<'de> MainProtocolOnAnonRequest<'de> { |
| 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::MainProtocolOnAnonRequest<'de>> { |
| if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None } |
| } |
| |
| pub fn into_option( |
| self, |
| ) -> ::core::option::Option<crate::wire::MainProtocolOnAnonRequest<'de>> { |
| if self.is_some() { |
| Some(crate::wire::MainProtocolOnAnonRequest { |
| raw: self.raw, |
| _phantom: ::core::marker::PhantomData, |
| }) |
| } else { |
| None |
| } |
| } |
| } |
| |
| unsafe impl<___D> ::fidl_next::Decode<___D> for MainProtocolOnAnonRequest<'static> |
| where |
| ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized, |
| ___D: ::fidl_next::Decoder, |
| { |
| 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::<___D, bool>(raw, decoder, ())?, |
| |
| 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?, |
| _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?, |
| } |
| |
| Ok(()) |
| } |
| } |
| |
| impl<'de> ::core::fmt::Debug for MainProtocolOnAnonRequest<'de> { |
| fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { |
| self.as_ref().fmt(f) |
| } |
| } |
| |
| impl<'de> ::fidl_next::IntoNatural for MainProtocolOnAnonRequest<'de> { |
| type Natural = ::core::option::Option<crate::natural::MainProtocolOnAnonRequest>; |
| } |
| |
| impl ::fidl_next::Unconstrained for MainProtocolOnAnonRequest<'static> {} |
| } |
| |
| pub mod generic {} |
| |
| pub use self::natural::*; |
| |
| /// Compatibility shims which mimic some API surfaces of the current Rust bindings. |
| pub mod compat { |
| |
| impl ::fidl_next::CompatFrom<crate::LocalTablePayload> |
| for ::fidl_test_protocollayouts::LocalTablePayload |
| { |
| fn compat_from(value: crate::LocalTablePayload) -> Self { |
| Self { |
| a: ::fidl_next::CompatFrom::compat_from(value.a), |
| |
| __source_breaking: ::fidl::marker::SourceBreaking, |
| } |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<::fidl_test_protocollayouts::LocalTablePayload> |
| for crate::LocalTablePayload |
| { |
| fn compat_from(value: ::fidl_test_protocollayouts::LocalTablePayload) -> Self { |
| Self { a: ::fidl_next::CompatFrom::compat_from(value.a) } |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<crate::LocalUnionPayload> |
| for ::fidl_test_protocollayouts::LocalUnionPayload |
| { |
| fn compat_from(value: crate::LocalUnionPayload) -> Self { |
| match value { |
| crate::LocalUnionPayload::B(value) => { |
| Self::B(::fidl_next::CompatFrom::compat_from(value)) |
| } |
| |
| crate::LocalUnionPayload::UnknownOrdinal_(unknown_ordinal) => { |
| Self::__SourceBreaking { unknown_ordinal } |
| } |
| } |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<::fidl_test_protocollayouts::LocalUnionPayload> |
| for crate::LocalUnionPayload |
| { |
| fn compat_from(value: ::fidl_test_protocollayouts::LocalUnionPayload) -> Self { |
| match value { |
| ::fidl_test_protocollayouts::LocalUnionPayload::B(value) => { |
| Self::B(::fidl_next::CompatFrom::compat_from(value)) |
| } |
| |
| ::fidl_test_protocollayouts::LocalUnionPayload::__SourceBreaking { |
| unknown_ordinal, |
| } => Self::UnknownOrdinal_(unknown_ordinal), |
| } |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<crate::MainProtocolOneWayAnonRequest> |
| for ::fidl_test_protocollayouts::MainProtocolOneWayAnonRequest |
| { |
| fn compat_from(value: crate::MainProtocolOneWayAnonRequest) -> Self { |
| Self { |
| a: ::fidl_next::CompatFrom::compat_from(value.a), |
| |
| __source_breaking: ::fidl::marker::SourceBreaking, |
| } |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<::fidl_test_protocollayouts::MainProtocolOneWayAnonRequest> |
| for crate::MainProtocolOneWayAnonRequest |
| { |
| fn compat_from(value: ::fidl_test_protocollayouts::MainProtocolOneWayAnonRequest) -> Self { |
| Self { a: ::fidl_next::CompatFrom::compat_from(value.a) } |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<crate::MainProtocolTwoWayAnonRequest> |
| for ::fidl_test_protocollayouts::MainProtocolTwoWayAnonRequest |
| { |
| fn compat_from(value: crate::MainProtocolTwoWayAnonRequest) -> Self { |
| match value { |
| crate::MainProtocolTwoWayAnonRequest::B(value) => { |
| Self::B(::fidl_next::CompatFrom::compat_from(value)) |
| } |
| |
| crate::MainProtocolTwoWayAnonRequest::UnknownOrdinal_(unknown_ordinal) => { |
| Self::__SourceBreaking { unknown_ordinal } |
| } |
| } |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<::fidl_test_protocollayouts::MainProtocolTwoWayAnonRequest> |
| for crate::MainProtocolTwoWayAnonRequest |
| { |
| fn compat_from(value: ::fidl_test_protocollayouts::MainProtocolTwoWayAnonRequest) -> Self { |
| match value { |
| ::fidl_test_protocollayouts::MainProtocolTwoWayAnonRequest::B(value) => { |
| Self::B(::fidl_next::CompatFrom::compat_from(value)) |
| } |
| |
| ::fidl_test_protocollayouts::MainProtocolTwoWayAnonRequest::__SourceBreaking { |
| unknown_ordinal, |
| } => Self::UnknownOrdinal_(unknown_ordinal), |
| } |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<crate::MainProtocolTwoWayAnonResponse> |
| for ::fidl_test_protocollayouts::MainProtocolTwoWayAnonResponse |
| { |
| fn compat_from(value: crate::MainProtocolTwoWayAnonResponse) -> Self { |
| Self { |
| a: ::fidl_next::CompatFrom::compat_from(value.a), |
| |
| __source_breaking: ::fidl::marker::SourceBreaking, |
| } |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<::fidl_test_protocollayouts::MainProtocolTwoWayAnonResponse> |
| for crate::MainProtocolTwoWayAnonResponse |
| { |
| fn compat_from(value: ::fidl_test_protocollayouts::MainProtocolTwoWayAnonResponse) -> Self { |
| Self { a: ::fidl_next::CompatFrom::compat_from(value.a) } |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<crate::MainProtocolTwoWayAnonWithErrorRequest> |
| for ::fidl_test_protocollayouts::MainProtocolTwoWayAnonWithErrorRequest |
| { |
| fn compat_from(value: crate::MainProtocolTwoWayAnonWithErrorRequest) -> Self { |
| Self { |
| a: ::fidl_next::CompatFrom::compat_from(value.a), |
| |
| __source_breaking: ::fidl::marker::SourceBreaking, |
| } |
| } |
| } |
| |
| impl |
| ::fidl_next::CompatFrom<::fidl_test_protocollayouts::MainProtocolTwoWayAnonWithErrorRequest> |
| for crate::MainProtocolTwoWayAnonWithErrorRequest |
| { |
| fn compat_from( |
| value: ::fidl_test_protocollayouts::MainProtocolTwoWayAnonWithErrorRequest, |
| ) -> Self { |
| Self { a: ::fidl_next::CompatFrom::compat_from(value.a) } |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<crate::MainProtocolTwoWayAnonWithErrorResponse> |
| for ::fidl_test_protocollayouts::MainProtocolTwoWayAnonWithErrorResponse |
| { |
| fn compat_from(value: crate::MainProtocolTwoWayAnonWithErrorResponse) -> Self { |
| match value { |
| crate::MainProtocolTwoWayAnonWithErrorResponse::B(value) => { |
| Self::B(::fidl_next::CompatFrom::compat_from(value)) |
| } |
| |
| crate::MainProtocolTwoWayAnonWithErrorResponse::UnknownOrdinal_( |
| unknown_ordinal, |
| ) => Self::__SourceBreaking { unknown_ordinal }, |
| } |
| } |
| } |
| |
| impl |
| ::fidl_next::CompatFrom< |
| ::fidl_test_protocollayouts::MainProtocolTwoWayAnonWithErrorResponse, |
| > for crate::MainProtocolTwoWayAnonWithErrorResponse |
| { |
| fn compat_from( |
| value: ::fidl_test_protocollayouts::MainProtocolTwoWayAnonWithErrorResponse, |
| ) -> Self { |
| match value { |
| |
| ::fidl_test_protocollayouts::MainProtocolTwoWayAnonWithErrorResponse::B(value) => |
| Self::B(::fidl_next::CompatFrom::compat_from(value)), |
| |
| |
| ::fidl_test_protocollayouts::MainProtocolTwoWayAnonWithErrorResponse::__SourceBreaking { unknown_ordinal } => |
| Self::UnknownOrdinal_(unknown_ordinal), |
| |
| } |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<crate::MainProtocolOnAnonRequest> |
| for ::fidl_test_protocollayouts::MainProtocolOnAnonRequest |
| { |
| fn compat_from(value: crate::MainProtocolOnAnonRequest) -> Self { |
| match value { |
| crate::MainProtocolOnAnonRequest::B(value) => { |
| Self::B(::fidl_next::CompatFrom::compat_from(value)) |
| } |
| |
| crate::MainProtocolOnAnonRequest::UnknownOrdinal_(unknown_ordinal) => { |
| Self::__SourceBreaking { unknown_ordinal } |
| } |
| } |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<::fidl_test_protocollayouts::MainProtocolOnAnonRequest> |
| for crate::MainProtocolOnAnonRequest |
| { |
| fn compat_from(value: ::fidl_test_protocollayouts::MainProtocolOnAnonRequest) -> Self { |
| match value { |
| ::fidl_test_protocollayouts::MainProtocolOnAnonRequest::B(value) => { |
| Self::B(::fidl_next::CompatFrom::compat_from(value)) |
| } |
| |
| ::fidl_test_protocollayouts::MainProtocolOnAnonRequest::__SourceBreaking { |
| unknown_ordinal, |
| } => Self::UnknownOrdinal_(unknown_ordinal), |
| } |
| } |
| } |
| } |