fidl_next::decode

Trait Decode

Source
pub unsafe trait Decode<D: ?Sized> {
    // Required method
    fn decode(slot: Slot<'_, Self>, decoder: &mut D) -> Result<(), DecodeError>;
}
Expand description

Decodes a value from the given slot.

§Safety

If decode returns Ok, then the provided slot must now contain a valid value of the implementing type.

Required Methods§

Source

fn decode(slot: Slot<'_, Self>, decoder: &mut D) -> Result<(), DecodeError>

Decodes a value into a slot using a decoder.

If decoding succeeds, slot will contain a valid value. If decoding fails, an error will be returned.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<D: ?Sized> Decode<D> for bool

Source§

fn decode(slot: Slot<'_, Self>, _: &mut D) -> Result<(), DecodeError>

Source§

impl<D: ?Sized> Decode<D> for i8

Source§

fn decode(_: Slot<'_, Self>, _: &mut D) -> Result<(), DecodeError>

Source§

impl<D: ?Sized> Decode<D> for u8

Source§

fn decode(_: Slot<'_, Self>, _: &mut D) -> Result<(), DecodeError>

Source§

impl<D: ?Sized, T: Decode<D>, const N: usize> Decode<D> for [T; N]

Source§

fn decode(slot: Slot<'_, Self>, decoder: &mut D) -> Result<(), DecodeError>

Implementors§

Source§

impl<'buf, D: Decoder<'buf> + ?Sized> Decode<D> for WireOptionalString<'buf>

Source§

impl<'buf, D: Decoder<'buf> + ?Sized> Decode<D> for WireString<'buf>

Source§

impl<'buf, D: Decoder<'buf> + ?Sized, T: Decode<D>> Decode<D> for WireBox<'buf, T>

Source§

impl<'buf, D: Decoder<'buf> + ?Sized, T: Decode<D>> Decode<D> for WireOptionalVector<'buf, T>

Source§

impl<'buf, D: Decoder<'buf> + ?Sized, T: Decode<D>> Decode<D> for WireVector<'buf, T>

Source§

impl<D: HandleDecoder + ?Sized> Decode<D> for WireChannel

Source§

impl<D: HandleDecoder + ?Sized> Decode<D> for WireHandle

Source§

impl<D: ?Sized> Decode<D> for WireMessageHeader

Source§

impl<D: ?Sized> Decode<D> for f32_le

Source§

impl<D: ?Sized> Decode<D> for f64_le

Source§

impl<D: ?Sized> Decode<D> for i16_le

Source§

impl<D: ?Sized> Decode<D> for i32_le

Source§

impl<D: ?Sized> Decode<D> for i64_le

Source§

impl<D: ?Sized> Decode<D> for u16_le

Source§

impl<D: ?Sized> Decode<D> for u32_le

Source§

impl<D: ?Sized> Decode<D> for u64_le

Source§

impl<D: ?Sized, T, P> Decode<D> for EndpointResource<T, P>
where T: Decode<D>,