Trait fidl_next::encoder::Encoder

source ·
pub trait Encoder {
    // Required methods
    fn bytes_written(&self) -> usize;
    fn reserve(&mut self, len: usize);
    fn write(&mut self, bytes: &[u8]);
    fn rewrite(&mut self, pos: usize, bytes: &[u8]);
}
Expand description

An encoder for FIDL messages.

Required Methods§

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.

Additional bytes are written to pad the written data to a multiple of [CHUNK_SIZE].

source

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

Copies bytes to the end of the encoder.

Additional bytes are written to pad the written data to a multiple of [CHUNK_SIZE].

source

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

Rewrites bytes at a position in the encoder.

Implementors§