Enum AttrHandle

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

Handle returned for traversing nested attribute structures

Variants§

§

Owned(O)

Owned vector

§

Borrowed(&'a [I])

Vector reference

Implementations§

Source§

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

Source

pub fn new(owned: O) -> Self

Create new AttrHandle

Source

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

Create new borrowed AttrHandle

Source

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

Pass back iterator over attributes

Source

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

Get the underlying owned value as a reference

Source§

impl<T> AttrHandle<'_, GenlBuffer<T, Buffer>, Nlattr<T, Buffer>>
where T: NlAttrType,

Source

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

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

Source

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

Get nested attributes from a parsed handle

Source

pub fn get_attr_payload_as<'b, R>(&'b self, attr: T) -> Result<R, DeError>
where R: FromBytes<'b>,

Parse binary payload as a type that implements FromBytes.

Source

pub fn get_attr_payload_as_with_len<'b, R>( &'b self, attr: T, ) -> Result<R, DeError>
where R: FromBytesWithInput<'b, Input = usize>,

Parse binary payload as a type that implements FromBytesWithInput

Source§

impl<T> AttrHandle<'_, RtBuffer<T, Buffer>, Rtattr<T, Buffer>>
where T: RtaType,

Source

pub fn get_nested_attributes<S>( &mut self, subattr: T, ) -> Result<AttrHandle<'_, RtBuffer<S, Buffer>, Rtattr<S, Buffer>>, 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<'b, R>(&'b self, attr: T) -> Result<R, DeError>
where R: FromBytes<'b>,

Parse binary payload as a type that implements FromBytes.

Source

pub fn get_attr_payload_as_with_len<'b, R>( &'b self, attr: T, ) -> Result<R, DeError>
where R: FromBytesWithInput<'b, Input = usize>,

Parse binary payload as a type that implements FromBytesWithInput.

Auto Trait Implementations§

§

impl<'a, O, I> Freeze for AttrHandle<'a, O, I>
where O: Freeze,

§

impl<'a, O, I> RefUnwindSafe for AttrHandle<'a, O, I>

§

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

§

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

§

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

§

impl<'a, O, I> UnwindSafe for AttrHandle<'a, O, I>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.