netlink_packet_utils::traits

Trait Emitable

Source
pub trait Emitable {
    // Required methods
    fn buffer_len(&self) -> usize;
    fn emit(&self, buffer: &mut [u8]);
}
Expand description

A type that implements Emitable can be serialized.

Required Methods§

Source

fn buffer_len(&self) -> usize

Return the length of the serialized data.

Source

fn emit(&self, buffer: &mut [u8])

Serialize this types and write the serialized data into the given buffer.

§Panic

This method panic if the buffer is not big enough. You must make sure the buffer is big enough before calling this method. You can use buffer_len() to check how big the storage needs to be.

Implementations on Foreign Types§

Source§

impl<'a, T: Nla> Emitable for &'a [T]

Source§

fn buffer_len(&self) -> usize

Source§

fn emit(&self, buffer: &mut [u8])

Implementors§

Source§

impl<T: Nla> Emitable for T