Trait bincode::enc::write::Writer

source ·
pub trait Writer {
    // Required method
    fn write(&mut self, bytes: &[u8]) -> Result<(), EncodeError>;
}
Expand description

Trait that indicates that a struct can be used as a destination to encode data too. This is used by Encode

Required Methods§

source

fn write(&mut self, bytes: &[u8]) -> Result<(), EncodeError>

Write bytes to the underlying writer. Exactly bytes.len() bytes must be written, or else an error should be returned.

Implementations on Foreign Types§

source§

impl<T: Writer> Writer for &mut T

source§

fn write(&mut self, bytes: &[u8]) -> Result<(), EncodeError>

Implementors§

source§

impl Writer for SizeWriter

source§

impl<'storage> Writer for SliceWriter<'storage>