[][src]Trait xaynet_core::message::ToBytes

pub trait ToBytes {
    fn buffer_length(&self) -> usize;
fn to_bytes<T: AsMut<[u8]> + AsRef<[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]> + AsRef<[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 Payload[src]

impl ToBytes for MaskConfig[src]

impl ToBytes for MaskObject[src]

impl ToBytes for Chunk[src]

impl ToBytes for Sum2[src]

impl ToBytes for Sum[src]

impl ToBytes for Update[src]

impl ToBytes for LocalSeedDict[src]

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

Loading content...