[][src]Enum neli::attr::AttrHandle

pub enum AttrHandle<'a, O, I> {
    Owned(O),
    Borrowed(&'a [I]),
}

Handle returned for traversing nested attribute structures

Variants

Owned(O)

Owned vector

Borrowed(&'a [I])

Vector reference

Implementations

impl<'a, O, I> AttrHandle<'a, O, I> where
    O: AsRef<[I]>, 
[src]

pub fn new(owned: O) -> Self[src]

Create new AttrHandle

pub fn new_borrowed(borrowed: &'a [I]) -> Self[src]

Create new borrowed AttrHandle

pub fn iter(&self) -> Iter<'_, I>

Notable traits for Iter<'a, T>

impl<'a, T> Iterator for Iter<'a, T> type Item = &'a T;
[src]

Pass back iterator over attributes

pub fn get_attrs(&self) -> &[I][src]

Get the underlying owned value as a reference

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

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

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

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

Get nested attributes from a parsed handle

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

Parse binary payload as a type that implements Nl using deserialize.

impl<'a, T> AttrHandle<'a, RtBuffer<T, Buffer>, Rtattr<T, Buffer>> where
    T: RtaType
[src]

pub fn get_nested_attributes<S>(
    &mut self,
    subattr: T
) -> Result<AttrHandle<'_, RtBuffer<S, Buffer>, Rtattr<S, Buffer>>, NlError> where
    S: RtaType
[src]

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

pub fn get_attribute(&self, t: T) -> Option<&Rtattr<T, Buffer>>[src]

Get nested attributes from a parsed handle.

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

Parse binary payload as a type that implements Nl using deserialize.

Auto Trait Implementations

impl<'a, O, I> RefUnwindSafe for AttrHandle<'a, O, I> where
    I: RefUnwindSafe,
    O: RefUnwindSafe
[src]

impl<'a, O, I> Send for AttrHandle<'a, O, I> where
    I: Sync,
    O: Send
[src]

impl<'a, O, I> Sync for AttrHandle<'a, O, I> where
    I: Sync,
    O: Sync
[src]

impl<'a, O, I> Unpin for AttrHandle<'a, O, I> where
    O: Unpin
[src]

impl<'a, O, I> UnwindSafe for AttrHandle<'a, O, I> where
    I: RefUnwindSafe,
    O: UnwindSafe
[src]

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<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.