[][src]Trait neli::Nl

pub trait Nl: Sized {
    fn serialize(&self, m: &mut StreamWriteBuffer) -> Result<(), SerError>;
fn deserialize<T>(m: &mut StreamReadBuffer<T>) -> Result<Self, DeError>
    where
        T: AsRef<[u8]>
;
fn size(&self) -> usize; fn asize(&self) -> usize { ... }
fn pad(&self, m: &mut StreamWriteBuffer) -> Result<(), SerError> { ... }
fn strip<T>(&self, m: &mut StreamReadBuffer<T>) -> Result<(), DeError>
    where
        T: AsRef<[u8]>
, { ... } }

Trait defining basic actions required for netlink communication. Implementations for basic and neli's types are provided (see below). Create new implementations if you have to work with a Netlink API that uses values of more unusual types.

Required methods

fn serialize(&self, m: &mut StreamWriteBuffer) -> Result<(), SerError>

Serialization method

fn deserialize<T>(m: &mut StreamReadBuffer<T>) -> Result<Self, DeError> where
    T: AsRef<[u8]>, 

Stateless deserialization method

fn size(&self) -> usize

The size of the binary representation of a struct - not aligned to word size

Loading content...

Provided methods

fn asize(&self) -> usize

The size of the binary representation of a struct - aligned to word size

fn pad(&self, m: &mut StreamWriteBuffer) -> Result<(), SerError>

Pad the data serialized data structure to alignment

fn strip<T>(&self, m: &mut StreamReadBuffer<T>) -> Result<(), DeError> where
    T: AsRef<[u8]>, 

Strip padding from the deserialization buffer

Loading content...

Implementations on Foreign Types

impl<T, P> Nl for Vec<Nlattr<T, P>> where
    T: NlAttrType,
    P: Nl
[src]

impl<'a, T> Nl for &'a [Nlattr<T, Vec<u8>>] where
    T: NlAttrType
[src]

impl<T, P> Nl for Vec<Rtattr<T, P>> where
    T: RtaType,
    P: Nl
[src]

impl Nl for u8[src]

impl Nl for u16[src]

impl Nl for u32[src]

impl Nl for i32[src]

impl Nl for u64[src]

impl<'a> Nl for &'a [u8][src]

impl Nl for Vec<u8>[src]

impl<'a> Nl for &'a str[src]

impl Nl for String[src]

Loading content...

Implementors

impl Nl for CtrlCmd[src]

impl Nl for GenlId[src]

impl Nl for NlmF[src]

impl Nl for Nlmsg[src]

impl Nl for Rtm[src]

impl Nl for CtrlAttr[src]

impl Nl for CtrlAttrMcastGrp[src]

impl Nl for Af[src]

impl Nl for Arphrd[src]

impl Nl for Ifa[src]

impl Nl for IfaF[src]

impl Nl for Iff[src]

impl Nl for Ifla[src]

impl Nl for Ntf[src]

impl Nl for Nud[src]

impl Nl for RtAddrFamily[src]

impl Nl for RtScope[src]

impl Nl for RtTable[src]

impl Nl for Rta[src]

impl Nl for RtmF[src]

impl Nl for Rtn[src]

impl Nl for Rtprot[src]

impl Nl for Tca[src]

impl Nl for AddrFamily[src]

impl Nl for NlFamily[src]

impl Nl for NlEmpty[src]

impl Nl for NdaCacheinfo[src]

impl Nl for Ndmsg[src]

impl Nl for Rtgenmsg[src]

impl<C, T> Nl for Genlmsghdr<C, T> where
    C: Cmd,
    T: NlAttrType
[src]

impl<T> Nl for Nlmsgerr<T> where
    T: NlType
[src]

impl<T> Nl for Ifaddrmsg<T> where
    T: RtaType
[src]

impl<T> Nl for Ifinfomsg<T> where
    T: RtaType
[src]

impl<T> Nl for Rtmsg<T> where
    T: RtaType
[src]

impl<T> Nl for Tcmsg<T> where
    T: RtaType
[src]

impl<T, P> Nl for Nlmsghdr<T, P> where
    T: NlType,
    P: Nl
[src]

impl<T, P> Nl for Nlattr<T, P> where
    T: NlAttrType,
    P: Nl
[src]

impl<T, P> Nl for Rtattr<T, P> where
    T: RtaType,
    P: Nl
[src]

Loading content...