Skip to main content

HasNlas

Trait HasNlas 

Source
pub trait HasNlas {
    // Required method
    fn attributes(
        &self,
    ) -> impl Iterator<Item = Result<NlaBuffer<&[u8]>, NlaError>>;

    // Provided method
    fn parse_attributes<'a, A, E>(
        &'a self,
        mode: NlaParseMode,
        parse_fn: impl Fn(&NlaBuffer<&'a [u8]>) -> Result<A, E>,
    ) -> Result<Vec<A>, E>
       where E: From<NlaError> { ... }
}
Expand description

A type that can iterate over and parse Netlink attributes.

Required Methods§

Source

fn attributes(&self) -> impl Iterator<Item = Result<NlaBuffer<&[u8]>, NlaError>>

Returns an iterator over the Netlink attribute buffers in self, or errors where the attribute length is invalid.

Provided Methods§

Source

fn parse_attributes<'a, A, E>( &'a self, mode: NlaParseMode, parse_fn: impl Fn(&NlaBuffer<&'a [u8]>) -> Result<A, E>, ) -> Result<Vec<A>, E>
where E: From<NlaError>,

Parses the Netlink attributes from self, using parse_fn to parse each attribute from an attribute buffer.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§