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§
sourcefn take_slot<T>(&mut self) -> Result<Slot<'buf, T>, DecodeError>
fn take_slot<T>(&mut self) -> Result<Slot<'buf, T>, DecodeError>
Takes enough chunks for a T
, returning a Slot
of the taken value.
sourcefn take_slice_slot<T>(
&mut self,
len: usize,
) -> Result<Slot<'buf, [T]>, DecodeError>
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.
sourcefn decode_next<T: Decode<Self>>(
&mut self,
) -> Result<Owned<'buf, T>, DecodeError>
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.
sourcefn decode_next_slice<T: Decode<Self>>(
&mut self,
len: usize,
) -> Result<Owned<'buf, [T]>, DecodeError>
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.