Trait Serialize

Source
pub trait Serialize {
    const FIXED_WORDS: usize;

    // Required methods
    fn tot_len(&self) -> usize;
    fn fill(&self, buf: &mut AllocBuf<'_>, a: &mut Alloc<'_>) -> Result<()>;
}

Required Associated Constants§

Required Methods§

Source

fn tot_len(&self) -> usize

Source

fn fill(&self, buf: &mut AllocBuf<'_>, a: &mut Alloc<'_>) -> Result<()>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Serialize for u32

Source§

const FIXED_WORDS: usize = 1usize

Source§

fn tot_len(&self) -> usize

Source§

fn fill(&self, buf: &mut AllocBuf<'_>, _a: &mut Alloc<'_>) -> Result<()>

Source§

impl Serialize for ()

Source§

const FIXED_WORDS: usize = 0usize

Source§

fn tot_len(&self) -> usize

Source§

fn fill(&self, _buf: &mut AllocBuf<'_>, _a: &mut Alloc<'_>) -> Result<()>

Source§

impl Serialize for String

Source§

const FIXED_WORDS: usize = 2usize

Source§

fn tot_len(&self) -> usize

Source§

fn fill(&self, buf: &mut AllocBuf<'_>, a: &mut Alloc<'_>) -> Result<()>

Source§

impl Serialize for Vec<u8>

Source§

const FIXED_WORDS: usize = 2usize

Source§

fn tot_len(&self) -> usize

Source§

fn fill(&self, buf: &mut AllocBuf<'_>, a: &mut Alloc<'_>) -> Result<()>

Source§

impl<T: Serialize> Serialize for Option<T>

Source§

const FIXED_WORDS: usize = 1usize

Source§

fn tot_len(&self) -> usize

Source§

fn fill(&self, buf: &mut AllocBuf<'_>, a: &mut Alloc<'_>) -> Result<()>

Source§

impl<T: Serialize> Serialize for Box<T>

Source§

const FIXED_WORDS: usize = T::FIXED_WORDS

Source§

fn tot_len(&self) -> usize

Source§

fn fill(&self, buf: &mut AllocBuf<'_>, a: &mut Alloc<'_>) -> Result<()>

Source§

impl<T: Serialize> Serialize for Vec<T>

Source§

const FIXED_WORDS: usize = 2usize

Source§

fn tot_len(&self) -> usize

Source§

fn fill(&self, buf: &mut AllocBuf<'_>, a: &mut Alloc<'_>) -> Result<()>

Source§

impl<T: Serialize, const N: usize> Serialize for [T; N]

Source§

const FIXED_WORDS: usize

Source§

fn tot_len(&self) -> usize

Source§

fn fill(&self, buf: &mut AllocBuf<'_>, a: &mut Alloc<'_>) -> Result<()>

Source§

impl<TupleElement0: Serialize> Serialize for (TupleElement0,)

Source§

const FIXED_WORDS: usize = TupleElement0::FIXED_WORDS

Source§

fn tot_len(&self) -> usize

Source§

fn fill(&self, buf: &mut AllocBuf<'_>, a: &mut Alloc<'_>) -> Result<()>

Source§

impl<TupleElement0: Serialize, TupleElement1: Serialize> Serialize for (TupleElement0, TupleElement1)

Source§

const FIXED_WORDS: usize

Source§

fn tot_len(&self) -> usize

Source§

fn fill(&self, buf: &mut AllocBuf<'_>, a: &mut Alloc<'_>) -> Result<()>

Source§

impl<TupleElement0: Serialize, TupleElement1: Serialize, TupleElement2: Serialize> Serialize for (TupleElement0, TupleElement1, TupleElement2)

Source§

const FIXED_WORDS: usize

Source§

fn tot_len(&self) -> usize

Source§

fn fill(&self, buf: &mut AllocBuf<'_>, a: &mut Alloc<'_>) -> Result<()>

Source§

impl<TupleElement0: Serialize, TupleElement1: Serialize, TupleElement2: Serialize, TupleElement3: Serialize> Serialize for (TupleElement0, TupleElement1, TupleElement2, TupleElement3)

Source§

const FIXED_WORDS: usize

Source§

fn tot_len(&self) -> usize

Source§

fn fill(&self, buf: &mut AllocBuf<'_>, a: &mut Alloc<'_>) -> Result<()>

Source§

impl<TupleElement0: Serialize, TupleElement1: Serialize, TupleElement2: Serialize, TupleElement3: Serialize, TupleElement4: Serialize> Serialize for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4)

Source§

const FIXED_WORDS: usize

Source§

fn tot_len(&self) -> usize

Source§

fn fill(&self, buf: &mut AllocBuf<'_>, a: &mut Alloc<'_>) -> Result<()>

Source§

impl<const N: usize> Serialize for [u8; N]

Source§

const FIXED_WORDS: usize

Source§

fn tot_len(&self) -> usize

Source§

fn fill(&self, buf: &mut AllocBuf<'_>, _a: &mut Alloc<'_>) -> Result<()>

Implementors§