blob: 56700572b24015bb417202a68d9b8979ef17c276 [file] [log] [blame]
// DO NOT EDIT: This file is machine-generated by fidlgen
#![warn(clippy::all)]
#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
#[derive(Clone, Debug)]
#[repr(C)]
pub struct Baz {
pub g: ::fidl_next_test_middle::Bar,
}
impl ::fidl_next::Encodable for Baz {
const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
::fidl_next::CopyOptimization::enable_if(
true && <::fidl_next_test_middle::Bar as ::fidl_next::Encodable>::COPY_OPTIMIZATION
.is_enabled(),
)
};
type Encoded = WireBaz;
}
impl<___E> ::fidl_next::Encode<___E> for Baz
where
___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
{
#[inline]
fn encode(
&mut self,
encoder: &mut ___E,
slot: ::fidl_next::Slot<'_, Self::Encoded>,
) -> Result<(), ::fidl_next::EncodeError> {
::fidl_next::munge! {
let Self::Encoded {
g,
} = slot;
}
::fidl_next::Encode::encode(&mut self.g, encoder, g)?;
Ok(())
}
}
impl ::fidl_next::EncodableOption for Box<Baz> {
type EncodedOption = ::fidl_next::WireBox<WireBaz>;
}
impl<___E> ::fidl_next::EncodeOption<___E> for Box<Baz>
where
___E: ::fidl_next::Encoder + ?Sized,
Baz: ::fidl_next::Encode<___E>,
{
#[inline]
fn encode_option(
this: Option<&mut Self>,
encoder: &mut ___E,
slot: ::fidl_next::Slot<'_, Self::EncodedOption>,
) -> Result<(), ::fidl_next::EncodeError> {
if let Some(inner) = this {
::fidl_next::EncoderExt::encode_next(encoder, inner)?;
::fidl_next::WireBox::encode_present(slot);
} else {
::fidl_next::WireBox::encode_absent(slot);
}
Ok(())
}
}
impl ::fidl_next::TakeFrom<WireBaz> for Baz {
const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
::fidl_next::CopyOptimization::enable_if(
true && <::fidl_next_test_middle::Bar as ::fidl_next::Encodable>::COPY_OPTIMIZATION
.is_enabled(),
)
};
#[inline]
fn take_from(from: &WireBaz) -> Self {
Self { g: ::fidl_next::TakeFrom::take_from(&from.g) }
}
}
/// The wire type corersponding to [`Baz`].
#[derive(Clone, Debug)]
#[repr(C)]
pub struct WireBaz {
pub g: ::fidl_next_test_middle::WireBar,
}
unsafe impl ::fidl_next::ZeroPadding for WireBaz {
#[inline]
unsafe fn zero_padding(ptr: *mut Self) {}
}
unsafe impl<___D> ::fidl_next::Decode<___D> for WireBaz
where
___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
{
fn decode(
slot: ::fidl_next::Slot<'_, Self>,
decoder: &mut ___D,
) -> Result<(), ::fidl_next::DecodeError> {
::fidl_next::munge! {
let Self {
mut g,
} = slot;
}
::fidl_next::Decode::decode(g.as_mut(), decoder)?;
Ok(())
}
}
/// Compatibility shims which mimic some API surfaces of the current Rust bindings.
pub mod compat {}