Struct fidl_next::encoder::BasicEncoder

source ·
pub struct BasicEncoder { /* private fields */ }
Expand description

A basic FIDL encoder.

Basic FIDL encoders do not support resources.

Implementations§

source§

impl BasicEncoder

source

pub fn new() -> Self

Returns a new base encoder.

source

pub fn finish(self) -> Vec<Chunk>

Finishes encoding, returning the encoded chunks and handles.

Trait Implementations§

source§

impl Default for BasicEncoder

source§

fn default() -> BasicEncoder

Returns the “default value” for a type. Read more
source§

impl Encoder for BasicEncoder

source§

fn bytes_written(&self) -> usize

Returns the number of bytes written to the encoder.
source§

fn reserve(&mut self, len: usize)

Writes zeroed bytes to the end of the encoder. Read more
source§

fn write(&mut self, bytes: &[u8])

Copies bytes to the end of the encoder. Read more
source§

fn rewrite(&mut self, pos: usize, bytes: &[u8])

Rewrites bytes at a position in the encoder.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

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

source§

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

Pre-allocates space for a slice of elements.
source§

fn encode_slice<T>(&mut self, values: &mut [T]) -> Result<(), EncodeError>
where T: Encode<E>,

Encodes a slice of elements. Read more
source§

fn encode<T>(&mut self, value: &mut T) -> Result<(), EncodeError>
where T: Encode<E>,

Encodes a value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.