Type Alias RtAttrHandle

Source
pub type RtAttrHandle<'a, T> = AttrHandle<'a, RtBuffer<T, Buffer>, Rtattr<T, Buffer>>;
Expand description

Represents a routing netlink attribute handle.

Aliased Type§

pub enum RtAttrHandle<'a, T> {
    Owned(RtBuffer<T, Buffer>),
    Borrowed(&'a [Rtattr<T, Buffer>]),
}

Variants§

§

Owned(RtBuffer<T, Buffer>)

Owned vector

§

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

Vector reference

Implementations§

Source§

impl<'a, T> RtAttrHandle<'a, T>
where T: RtaType,

Source

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

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

Source

pub fn get_attribute(&self, t: T) -> Option<&Rtattr<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 FromBytesWithInput.