Trait Encoder

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§

fn bytes_written(&self) -> usize

Returns the number of bytes written to the encoder.

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.

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.

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

Rewrites bytes at a position in the encoder.

Implementations on Foreign Types§

§

impl Encoder for Vec<WireU64>

§

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])

Implementors§

§

impl Encoder for Buffer