[−][src]Enum neli::nlattr::AttrHandle
Handle returned by Genlmsghdr
for traversing nested attribute structures
Variants
Owned(Vec<Nlattr<T, Vec<u8>>>)
Owned vector
Borrowed(&'a Vec<Nlattr<T, Vec<u8>>>)
Vector reference
Methods
impl<'a, T> AttrHandle<'a, T> where
T: NlAttrType,
[src]
T: NlAttrType,
pub fn new(vec: Vec<Nlattr<T, Vec<u8>>>) -> Self
[src]
Create new AttrHandle
pub fn new_borrowed(vec: &'a Vec<Nlattr<T, Vec<u8>>>) -> Self
[src]
Create new borrowed AttrHandle
pub fn get_vec(&self) -> &Vec<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]
&mut self,
subattr: T
) -> Result<AttrHandle<S>, NlError> where
S: NlAttrType,
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]
&'b mut self,
t: T
) -> Option<&'b mut Nlattr<T, Vec<u8>>>
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]
R: Nl,
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,
T: Send + Sync,
impl<'a, T> Sync for AttrHandle<'a, T> where
T: Sync,
T: Sync,
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,