Trait nanoserde::SerBin[][src]

pub trait SerBin {
    fn ser_bin(&self, output: &mut Vec<u8>);

    fn serialize_bin(&self) -> Vec<u8> { ... }
}
Expand description

A trait for objects that can be serialized to binary.

Required methods

Serialize Self to bytes.

let mut s = Vec::new();
42u32.ser_bin(&mut s);
assert_eq!(s, vec![42, 0, 0, 0])

Provided methods

Serialize Self to bytes.

This is a convenient wrapper around ser_bin.

Implementations on Foreign Types

Implementors