[][src]Trait xaynet::message::ToBytes

pub trait ToBytes {
    fn buffer_length(&self) -> usize;
fn to_bytes<T: AsMut<[u8]>>(&self, buffer: &mut T); }

An interface for serializable message types.

See also FromBytes for deserialization.

Required methods

fn buffer_length(&self) -> usize

The length of the buffer for encoding the type.

fn to_bytes<T: AsMut<[u8]>>(&self, buffer: &mut T)

Serialize the type in the given buffer.

Panics

This method may panic if the given buffer is too small. Thus, buffer_length() must be called prior to calling this, and a large enough buffer must be provided.

Loading content...

Implementors

impl ToBytes for Certificate[src]

impl ToBytes for MaskConfig[src]

impl ToBytes for MaskObject[src]

impl ToBytes for Sum[src]

impl ToBytes for LocalSeedDict[src]

impl<C> ToBytes for Header<C> where
    C: Borrow<Certificate>, 
[src]

impl<C, D, M, N> ToBytes for Message<C, D, M, N> where
    C: Borrow<Certificate>,
    D: Borrow<LocalSeedDict>,
    M: Borrow<MaskObject>,
    N: Borrow<MaskObject>, 
[src]

impl<D, M> ToBytes for Update<D, M> where
    D: Borrow<LocalSeedDict>,
    M: Borrow<MaskObject>, 
[src]

impl<D, M, N> ToBytes for Payload<D, M, N> where
    D: Borrow<LocalSeedDict>,
    M: Borrow<MaskObject>,
    N: Borrow<MaskObject>, 
[src]

impl<M> ToBytes for Sum2<M> where
    M: Borrow<MaskObject>, 
[src]

impl<T> ToBytes for T where
    T: ByteObject
[src]

Loading content...