| // DO NOT EDIT: This file is machine-generated by fidlgen |
| #![warn(clippy::all)] |
| #![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)] |
| |
| pub mod natural { |
| |
| #[derive(PartialEq, Clone, Debug)] |
| pub struct ExampleUseOfErrorSyntaxCallWhichMayFailRequest { |
| pub s: ::std::string::String, |
| } |
| |
| unsafe impl<___E> |
| ::fidl_next::Encode< |
| crate::wire::ExampleUseOfErrorSyntaxCallWhichMayFailRequest<'static>, |
| ___E, |
| > for ExampleUseOfErrorSyntaxCallWhichMayFailRequest |
| 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::ExampleUseOfErrorSyntaxCallWhichMayFailRequest<'static>, |
| >, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let crate::wire::ExampleUseOfErrorSyntaxCallWhichMayFailRequest { |
| s, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(self.s, encoder_, s, 4294967295)?; |
| |
| let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(s.as_mut_ptr()) }; |
| ::fidl_next::Constrained::validate(_field, 4294967295)?; |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<'a, ___E> |
| ::fidl_next::Encode< |
| crate::wire::ExampleUseOfErrorSyntaxCallWhichMayFailRequest<'static>, |
| ___E, |
| > for &'a ExampleUseOfErrorSyntaxCallWhichMayFailRequest |
| 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::ExampleUseOfErrorSyntaxCallWhichMayFailRequest<'static>, |
| >, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let crate::wire::ExampleUseOfErrorSyntaxCallWhichMayFailRequest { |
| |
| s, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(&self.s, encoder_, s, 4294967295)?; |
| |
| let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(s.as_mut_ptr()) }; |
| ::fidl_next::Constrained::validate(_field, 4294967295)?; |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<___E> |
| ::fidl_next::EncodeOption< |
| ::fidl_next::WireBox< |
| 'static, |
| crate::wire::ExampleUseOfErrorSyntaxCallWhichMayFailRequest<'static>, |
| >, |
| ___E, |
| > for ExampleUseOfErrorSyntaxCallWhichMayFailRequest |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| ExampleUseOfErrorSyntaxCallWhichMayFailRequest: ::fidl_next::Encode< |
| crate::wire::ExampleUseOfErrorSyntaxCallWhichMayFailRequest<'static>, |
| ___E, |
| >, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit< |
| ::fidl_next::WireBox< |
| 'static, |
| crate::wire::ExampleUseOfErrorSyntaxCallWhichMayFailRequest<'static>, |
| >, |
| >, |
| _: (), |
| ) -> ::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::ExampleUseOfErrorSyntaxCallWhichMayFailRequest<'static>, |
| >, |
| ___E, |
| > for &'a ExampleUseOfErrorSyntaxCallWhichMayFailRequest |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| &'a ExampleUseOfErrorSyntaxCallWhichMayFailRequest: ::fidl_next::Encode< |
| crate::wire::ExampleUseOfErrorSyntaxCallWhichMayFailRequest<'static>, |
| ___E, |
| >, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit< |
| ::fidl_next::WireBox< |
| 'static, |
| crate::wire::ExampleUseOfErrorSyntaxCallWhichMayFailRequest<'static>, |
| >, |
| >, |
| _: (), |
| ) -> ::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<'de> |
| ::fidl_next::FromWire<crate::wire::ExampleUseOfErrorSyntaxCallWhichMayFailRequest<'de>> |
| for ExampleUseOfErrorSyntaxCallWhichMayFailRequest |
| { |
| #[inline] |
| fn from_wire( |
| wire: crate::wire::ExampleUseOfErrorSyntaxCallWhichMayFailRequest<'de>, |
| ) -> Self { |
| Self { s: ::fidl_next::FromWire::from_wire(wire.s) } |
| } |
| } |
| |
| impl<'de> |
| ::fidl_next::FromWireRef<crate::wire::ExampleUseOfErrorSyntaxCallWhichMayFailRequest<'de>> |
| for ExampleUseOfErrorSyntaxCallWhichMayFailRequest |
| { |
| #[inline] |
| fn from_wire_ref( |
| wire: &crate::wire::ExampleUseOfErrorSyntaxCallWhichMayFailRequest<'de>, |
| ) -> Self { |
| Self { s: ::fidl_next::FromWireRef::from_wire_ref(&wire.s) } |
| } |
| } |
| |
| #[derive(PartialEq, Clone, Debug)] |
| #[repr(C)] |
| pub struct ExampleUseOfErrorSyntaxCallWhichMayFailResponse { |
| pub value: i64, |
| } |
| |
| unsafe impl<___E> |
| ::fidl_next::Encode<crate::wire::ExampleUseOfErrorSyntaxCallWhichMayFailResponse, ___E> |
| for ExampleUseOfErrorSyntaxCallWhichMayFailResponse |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| { |
| const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization< |
| Self, |
| crate::wire::ExampleUseOfErrorSyntaxCallWhichMayFailResponse, |
| > = unsafe { |
| ::fidl_next::CopyOptimization::enable_if( |
| true && <i64 as ::fidl_next::Encode<::fidl_next::WireI64, ___E>>::COPY_OPTIMIZATION |
| .is_enabled(), |
| ) |
| }; |
| |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit< |
| crate::wire::ExampleUseOfErrorSyntaxCallWhichMayFailResponse, |
| >, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let crate::wire::ExampleUseOfErrorSyntaxCallWhichMayFailResponse { |
| value, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(self.value, encoder_, value, ())?; |
| |
| let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(value.as_mut_ptr()) }; |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<'a, ___E> |
| ::fidl_next::Encode<crate::wire::ExampleUseOfErrorSyntaxCallWhichMayFailResponse, ___E> |
| for &'a ExampleUseOfErrorSyntaxCallWhichMayFailResponse |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit< |
| crate::wire::ExampleUseOfErrorSyntaxCallWhichMayFailResponse, |
| >, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let crate::wire::ExampleUseOfErrorSyntaxCallWhichMayFailResponse { |
| |
| value, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(&self.value, encoder_, value, ())?; |
| |
| let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(value.as_mut_ptr()) }; |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<___E> |
| ::fidl_next::EncodeOption< |
| ::fidl_next::WireBox< |
| 'static, |
| crate::wire::ExampleUseOfErrorSyntaxCallWhichMayFailResponse, |
| >, |
| ___E, |
| > for ExampleUseOfErrorSyntaxCallWhichMayFailResponse |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| ExampleUseOfErrorSyntaxCallWhichMayFailResponse: |
| ::fidl_next::Encode<crate::wire::ExampleUseOfErrorSyntaxCallWhichMayFailResponse, ___E>, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit< |
| ::fidl_next::WireBox< |
| 'static, |
| crate::wire::ExampleUseOfErrorSyntaxCallWhichMayFailResponse, |
| >, |
| >, |
| _: (), |
| ) -> ::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::ExampleUseOfErrorSyntaxCallWhichMayFailResponse, |
| >, |
| ___E, |
| > for &'a ExampleUseOfErrorSyntaxCallWhichMayFailResponse |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| &'a ExampleUseOfErrorSyntaxCallWhichMayFailResponse: |
| ::fidl_next::Encode<crate::wire::ExampleUseOfErrorSyntaxCallWhichMayFailResponse, ___E>, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit< |
| ::fidl_next::WireBox< |
| 'static, |
| crate::wire::ExampleUseOfErrorSyntaxCallWhichMayFailResponse, |
| >, |
| >, |
| _: (), |
| ) -> ::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::ExampleUseOfErrorSyntaxCallWhichMayFailResponse> |
| for ExampleUseOfErrorSyntaxCallWhichMayFailResponse |
| { |
| const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization< |
| crate::wire::ExampleUseOfErrorSyntaxCallWhichMayFailResponse, |
| Self, |
| > = unsafe { |
| ::fidl_next::CopyOptimization::enable_if( |
| true && <i64 as ::fidl_next::FromWire<::fidl_next::WireI64>>::COPY_OPTIMIZATION |
| .is_enabled(), |
| ) |
| }; |
| |
| #[inline] |
| fn from_wire(wire: crate::wire::ExampleUseOfErrorSyntaxCallWhichMayFailResponse) -> Self { |
| Self { value: ::fidl_next::FromWire::from_wire(wire.value) } |
| } |
| } |
| |
| impl ::fidl_next::FromWireRef<crate::wire::ExampleUseOfErrorSyntaxCallWhichMayFailResponse> |
| for ExampleUseOfErrorSyntaxCallWhichMayFailResponse |
| { |
| #[inline] |
| fn from_wire_ref( |
| wire: &crate::wire::ExampleUseOfErrorSyntaxCallWhichMayFailResponse, |
| ) -> Self { |
| Self { value: ::fidl_next::FromWireRef::from_wire_ref(&wire.value) } |
| } |
| } |
| } |
| |
| pub mod wire { |
| |
| /// The wire type corresponding to [`ExampleUseOfErrorSyntaxCallWhichMayFailRequest`]. |
| #[derive(Debug)] |
| #[repr(C)] |
| pub struct ExampleUseOfErrorSyntaxCallWhichMayFailRequest<'de> { |
| pub s: ::fidl_next::WireString<'de>, |
| } |
| |
| static_assertions::const_assert_eq!( |
| std::mem::size_of::<ExampleUseOfErrorSyntaxCallWhichMayFailRequest<'_>>(), |
| 16 |
| ); |
| static_assertions::const_assert_eq!( |
| std::mem::align_of::<ExampleUseOfErrorSyntaxCallWhichMayFailRequest<'_>>(), |
| 8 |
| ); |
| |
| static_assertions::const_assert_eq!( |
| std::mem::offset_of!(ExampleUseOfErrorSyntaxCallWhichMayFailRequest<'_>, s), |
| 0 |
| ); |
| |
| unsafe impl ::fidl_next::Wire for ExampleUseOfErrorSyntaxCallWhichMayFailRequest<'static> { |
| type Owned<'de> = ExampleUseOfErrorSyntaxCallWhichMayFailRequest<'de>; |
| |
| #[inline] |
| fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) { |
| ::fidl_next::munge! { |
| let Self { |
| |
| s, |
| |
| } = &mut *out_; |
| } |
| |
| ::fidl_next::Wire::zero_padding(s); |
| } |
| } |
| |
| unsafe impl<___D> ::fidl_next::Decode<___D> |
| for ExampleUseOfErrorSyntaxCallWhichMayFailRequest<'static> |
| where |
| ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized, |
| ___D: ::fidl_next::Decoder, |
| { |
| fn decode( |
| slot_: ::fidl_next::Slot<'_, Self>, |
| decoder_: &mut ___D, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::DecodeError> { |
| ::fidl_next::munge! { |
| let Self { |
| |
| mut s, |
| |
| } = slot_; |
| } |
| |
| let _field = s.as_mut(); |
| ::fidl_next::Constrained::validate(_field, 4294967295)?; |
| ::fidl_next::Decode::decode(s.as_mut(), decoder_, 4294967295)?; |
| |
| Ok(()) |
| } |
| } |
| |
| impl<'de> ::fidl_next::IntoNatural for ExampleUseOfErrorSyntaxCallWhichMayFailRequest<'de> { |
| type Natural = crate::natural::ExampleUseOfErrorSyntaxCallWhichMayFailRequest; |
| } |
| |
| impl ::fidl_next::Unconstrained for ExampleUseOfErrorSyntaxCallWhichMayFailRequest<'static> {} |
| |
| /// The wire type corresponding to [`ExampleUseOfErrorSyntaxCallWhichMayFailResponse`]. |
| #[derive(Clone, Debug)] |
| #[repr(C)] |
| pub struct ExampleUseOfErrorSyntaxCallWhichMayFailResponse { |
| pub value: ::fidl_next::WireI64, |
| } |
| |
| static_assertions::const_assert_eq!( |
| std::mem::size_of::<ExampleUseOfErrorSyntaxCallWhichMayFailResponse>(), |
| 8 |
| ); |
| static_assertions::const_assert_eq!( |
| std::mem::align_of::<ExampleUseOfErrorSyntaxCallWhichMayFailResponse>(), |
| 8 |
| ); |
| |
| static_assertions::const_assert_eq!( |
| std::mem::offset_of!(ExampleUseOfErrorSyntaxCallWhichMayFailResponse, value), |
| 0 |
| ); |
| |
| unsafe impl ::fidl_next::Wire for ExampleUseOfErrorSyntaxCallWhichMayFailResponse { |
| type Owned<'de> = ExampleUseOfErrorSyntaxCallWhichMayFailResponse; |
| |
| #[inline] |
| fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) { |
| ::fidl_next::munge! { |
| let Self { |
| |
| value, |
| |
| } = &mut *out_; |
| } |
| |
| ::fidl_next::Wire::zero_padding(value); |
| } |
| } |
| |
| unsafe impl<___D> ::fidl_next::Decode<___D> for ExampleUseOfErrorSyntaxCallWhichMayFailResponse |
| 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 value, |
| |
| } = slot_; |
| } |
| |
| let _field = value.as_mut(); |
| |
| ::fidl_next::Decode::decode(value.as_mut(), decoder_, ())?; |
| |
| Ok(()) |
| } |
| } |
| |
| impl ::fidl_next::IntoNatural for ExampleUseOfErrorSyntaxCallWhichMayFailResponse { |
| type Natural = crate::natural::ExampleUseOfErrorSyntaxCallWhichMayFailResponse; |
| } |
| |
| impl ::fidl_next::Unconstrained for ExampleUseOfErrorSyntaxCallWhichMayFailResponse {} |
| } |
| |
| pub mod wire_optional {} |
| |
| pub mod generic { |
| |
| pub struct ExampleUseOfErrorSyntaxCallWhichMayFailRequest<T0> { |
| pub s: T0, |
| } |
| |
| unsafe impl<___E, T0> |
| ::fidl_next::Encode< |
| crate::wire::ExampleUseOfErrorSyntaxCallWhichMayFailRequest<'static>, |
| ___E, |
| > for ExampleUseOfErrorSyntaxCallWhichMayFailRequest<T0> |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| ___E: ::fidl_next::Encoder, |
| T0: ::fidl_next::Encode<::fidl_next::WireString<'static>, ___E>, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit< |
| crate::wire::ExampleUseOfErrorSyntaxCallWhichMayFailRequest<'static>, |
| >, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let crate::wire::ExampleUseOfErrorSyntaxCallWhichMayFailRequest { |
| |
| s, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(self.s, encoder_, s, 4294967295)?; |
| |
| Ok(()) |
| } |
| } |
| |
| pub struct ExampleUseOfErrorSyntaxCallWhichMayFailResponse<T0> { |
| pub value: T0, |
| } |
| |
| unsafe impl<___E, T0> |
| ::fidl_next::Encode<crate::wire::ExampleUseOfErrorSyntaxCallWhichMayFailResponse, ___E> |
| for ExampleUseOfErrorSyntaxCallWhichMayFailResponse<T0> |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| T0: ::fidl_next::Encode<::fidl_next::WireI64, ___E>, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit< |
| crate::wire::ExampleUseOfErrorSyntaxCallWhichMayFailResponse, |
| >, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let crate::wire::ExampleUseOfErrorSyntaxCallWhichMayFailResponse { |
| |
| value, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(self.value, encoder_, value, ())?; |
| |
| 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::ExampleUseOfErrorSyntaxCallWhichMayFailRequest> |
| for ::fidl_test_errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailRequest |
| { |
| #[inline] |
| fn compat_from(value: crate::ExampleUseOfErrorSyntaxCallWhichMayFailRequest) -> Self { |
| Self { s: ::fidl_next::CompatFrom::compat_from(value.s) } |
| } |
| } |
| |
| impl |
| ::fidl_next::CompatFrom< |
| ::fidl_test_errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailRequest, |
| > for crate::ExampleUseOfErrorSyntaxCallWhichMayFailRequest |
| { |
| #[inline] |
| fn compat_from( |
| value: ::fidl_test_errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailRequest, |
| ) -> Self { |
| Self { s: ::fidl_next::CompatFrom::compat_from(value.s) } |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<crate::ExampleUseOfErrorSyntaxCallWhichMayFailResponse> |
| for ::fidl_test_errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailResponse |
| { |
| #[inline] |
| fn compat_from(value: crate::ExampleUseOfErrorSyntaxCallWhichMayFailResponse) -> Self { |
| Self { value: ::fidl_next::CompatFrom::compat_from(value.value) } |
| } |
| } |
| |
| impl |
| ::fidl_next::CompatFrom< |
| ::fidl_test_errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailResponse, |
| > for crate::ExampleUseOfErrorSyntaxCallWhichMayFailResponse |
| { |
| #[inline] |
| fn compat_from( |
| value: ::fidl_test_errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailResponse, |
| ) -> Self { |
| Self { value: ::fidl_next::CompatFrom::compat_from(value.value) } |
| } |
| } |
| } |