Skip to main content

Encoder

Trait Encoder 

Source
pub trait Encoder: InternalHandleEncoder {
    // Required methods
    fn bytes_written(&self) -> usize;
    fn write_zeroes(&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 write_zeroes(&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.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Encoder for Vec<Uint64>

Source§

fn bytes_written(&self) -> usize

Source§

fn write_zeroes(&mut self, len: usize)

Source§

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

Source§

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

Implementors§