[][src]Enum neli::nlattr::AttrHandle

pub enum AttrHandle<'a, T> {
    Owned(Vec<Nlattr<T, Vec<u8>>>),
    Borrowed(&'a [Nlattr<T, Vec<u8>>]),
}

Handle returned by Genlmsghdr for traversing nested attribute structures

Variants

Owned(Vec<Nlattr<T, Vec<u8>>>)

Owned vector

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

Vector reference

Methods

impl<'a, T> AttrHandle<'a, T> where
    T: NlAttrType
[src]

pub fn new(vec: Vec<Nlattr<T, Vec<u8>>>) -> Self[src]

Create new AttrHandle

pub fn new_borrowed(vec: &'a [Nlattr<T, Vec<u8>>]) -> Self[src]

Create new borrowed AttrHandle

pub fn get_slice(&self) -> &[Nlattr<T, Vec<u8>>][src]

Get the underlying Vec as a reference

pub fn get_vec_mut(&mut self) -> Option<&mut Vec<Nlattr<T, Vec<u8>>>>[src]

Get the underlying Vec as a mutable reference or return None

pub fn size(&self) -> usize[src]

Get size of buffer required to hold attributes

pub fn iter(&self) -> Iter<Nlattr<T, Vec<u8>>>[src]

If attributes are parsed, pass back iterator over attributes

pub fn get_nested_attributes<S>(
    &mut self,
    subattr: T
) -> Result<AttrHandle<S>, NlError> where
    S: NlAttrType
[src]

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

pub fn get_attribute<'b>(&'b self, t: T) -> Option<&'b Nlattr<T, Vec<u8>>>[src]

Get nested attributes from a parsed handle

pub fn get_attribute_mut<'b>(
    &'b mut self,
    t: T
) -> Option<&'b mut Nlattr<T, Vec<u8>>>
[src]

Mutably get nested attributes from a parsed handle

pub fn get_attr_payload_as<R>(&self, attr: T) -> Result<R, DeError> where
    R: Nl
[src]

Parse binary payload as a type that implements Nl using deserialize with an option size hint

Auto Trait Implementations

impl<'a, T> Send for AttrHandle<'a, T> where
    T: Send + Sync

impl<'a, T> Unpin for AttrHandle<'a, T> where
    T: Unpin

impl<'a, T> Sync for AttrHandle<'a, T> where
    T: Sync

impl<'a, T> UnwindSafe for AttrHandle<'a, T> where
    T: RefUnwindSafe + UnwindSafe

impl<'a, T> RefUnwindSafe for AttrHandle<'a, T> where
    T: RefUnwindSafe

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]