Trait radn::mode::Serializer

source ·
pub trait Serializer {
    // Required methods
    fn write(&mut self, buf: &[u8]);
    fn tell(&self) -> usize;
}
Expand description

Serialisation mechanism that is chosen over bytestring concatenation both for performance and simplicity.

See Serializable.

Required Methods§

source

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

Writes bytes from a slice. Should advance value of Serializer::tell() by buf.len.

source

fn tell(&self) -> usize

Current position of the stream. Used by CheckedSerialize.

Implementations on Foreign Types§

source§

impl Serializer for Vec<u8>

source§

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

source§

fn tell(&self) -> usize

Implementors§