fidl_next::encoder

Trait EncoderExt

Source
pub trait EncoderExt {
    // Required methods
    fn preallocate<T>(&mut self, len: usize) -> Preallocated<'_, Self, T>;
    fn encode_next_slice<T: Encode<Self>>(
        &mut self,
        values: &mut [T],
    ) -> Result<(), EncodeError>;
    fn encode_next<T: Encode<Self>>(
        &mut self,
        value: &mut T,
    ) -> Result<(), EncodeError>;
}
Expand description

Extension methods for Encoder.

Required Methods§

Source

fn preallocate<T>(&mut self, len: usize) -> Preallocated<'_, Self, T>

Pre-allocates space for a slice of elements.

Source

fn encode_next_slice<T: Encode<Self>>( &mut self, values: &mut [T], ) -> Result<(), EncodeError>

Encodes a slice of elements.

Returns Err if encoding failed.

Source

fn encode_next<T: Encode<Self>>( &mut self, value: &mut T, ) -> Result<(), EncodeError>

Encodes a value.

Returns Err if encoding failed.

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.

Implementors§

Source§

impl<E: Encoder + ?Sized> EncoderExt for E