Type Alias GenlAttrHandle

Source
pub type GenlAttrHandle<'a, T> = AttrHandle<'a, GenlBuffer<T, Buffer>, Nlattr<T, Buffer>>;
Expand description

Type representing a generic netlink attribute handle.

Aliased Type§

pub enum GenlAttrHandle<'a, T> {
    Owned(GenlBuffer<T, Buffer>),
    Borrowed(&'a [Nlattr<T, Buffer>]),
}

Variants§

§

Owned(GenlBuffer<T, Buffer>)

Owned vector

§

Borrowed(&'a [Nlattr<T, Buffer>])

Vector reference

Implementations§

Source§

impl<'a, T> GenlAttrHandle<'a, T>
where T: NlAttrType,

Source

pub fn get_nested_attributes<S>( &self, subattr: T, ) -> Result<GenlAttrHandle<'_, S>, DeError>
where S: NlAttrType,

Get the payload of an attribute as a handle for parsing nested attributes

Source

pub fn get_attribute(&self, t: T) -> Option<&Nlattr<T, Buffer>>

Get nested attributes from a parsed handle

Source

pub fn get_attr_payload_as<R>(&self, attr: T) -> Result<R, DeError>
where R: FromBytes,

Parse binary payload as a type that implements FromBytes.

Source

pub fn get_attr_payload_as_with_len<R>(&self, attr: T) -> Result<R, DeError>
where R: FromBytesWithInput<Input = usize>,

Parse binary payload as a type that implements FromBytesWithInput

Source

pub fn get_attr_payload_as_with_len_borrowed<R>( &'a self, attr: T, ) -> Result<R, DeError>
where R: FromBytesWithInputBorrowed<'a, Input = usize>,

Parse binary payload as a type that implements FromBytesWithInputBorrowed