Trait fidl_next::decoder::DecoderExt

source ·
pub trait DecoderExt<'buf> {
    // Required methods
    fn take_slot<T>(&mut self) -> Result<Slot<'buf, T>, DecodeError>;
    fn take_slice_slot<T>(
        &mut self,
        len: usize,
    ) -> Result<Slot<'buf, [T]>, DecodeError>;
    fn decode_next<T: Decode<Self>>(
        &mut self,
    ) -> Result<Owned<'buf, T>, DecodeError>;
    fn decode_next_slice<T: Decode<Self>>(
        &mut self,
        len: usize,
    ) -> Result<Owned<'buf, [T]>, DecodeError>;
}
Expand description

Extension methods for Decoder.

Required Methods§

source

fn take_slot<T>(&mut self) -> Result<Slot<'buf, T>, DecodeError>

Takes enough chunks for a T, returning a Slot of the taken value.

source

fn take_slice_slot<T>( &mut self, len: usize, ) -> Result<Slot<'buf, [T]>, DecodeError>

Takes enough chunks for a slice of T, returning a Slot of the taken slice.

source

fn decode_next<T: Decode<Self>>( &mut self, ) -> Result<Owned<'buf, T>, DecodeError>

Decodes a T and returns an Owned pointer to it.

Returns Err if decoding failed.

source

fn decode_next_slice<T: Decode<Self>>( &mut self, len: usize, ) -> Result<Owned<'buf, [T]>, DecodeError>

Decodes a slice of T and returns an Owned pointer to it.

Returns Err if decoding failed.

Object Safety§

This trait is not object safe.

Implementors§

source§

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