Enum neli::attr::AttrHandle
source · pub enum AttrHandle<'a, O, I> {
Owned(O),
Borrowed(&'a [I]),
}
Expand description
Handle returned for traversing nested attribute structures
Variants§
Implementations§
source§impl<'a, O, I> AttrHandle<'a, O, I>where
O: AsRef<[I]>,
impl<'a, O, I> AttrHandle<'a, O, I>where
O: AsRef<[I]>,
sourcepub fn new(owned: O) -> Self
pub fn new(owned: O) -> Self
Create new AttrHandle
sourcepub fn new_borrowed(borrowed: &'a [I]) -> Self
pub fn new_borrowed(borrowed: &'a [I]) -> Self
Create new borrowed AttrHandle
source§impl<'a, T> AttrHandle<'a, GenlBuffer<T, Buffer>, Nlattr<T, Buffer>>where
T: NlAttrType,
impl<'a, T> AttrHandle<'a, GenlBuffer<T, Buffer>, Nlattr<T, Buffer>>where
T: NlAttrType,
sourcepub fn get_nested_attributes<S>(
&mut self,
subattr: T
) -> Result<AttrHandle<'_, GenlBuffer<S, Buffer>, Nlattr<S, Buffer>>, DeError>where
S: NlAttrType,
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
sourcepub fn get_attribute(&self, t: T) -> Option<&Nlattr<T, Buffer>>
pub fn get_attribute(&self, t: T) -> Option<&Nlattr<T, Buffer>>
Get nested attributes from a parsed handle
sourcepub fn get_attr_payload_as<'b, R>(&'b self, attr: T) -> Result<R, DeError>where
R: FromBytes<'b>,
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
.
sourcepub fn get_attr_payload_as_with_len<'b, R>(
&'b self,
attr: T
) -> Result<R, DeError>where
R: FromBytesWithInput<'b, Input = usize>,
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<'a, T> AttrHandle<'a, RtBuffer<T, Buffer>, Rtattr<T, Buffer>>where
T: RtaType,
impl<'a, T> AttrHandle<'a, RtBuffer<T, Buffer>, Rtattr<T, Buffer>>where
T: RtaType,
sourcepub fn get_nested_attributes<S>(
&mut self,
subattr: T
) -> Result<AttrHandle<'_, RtBuffer<S, Buffer>, Rtattr<S, Buffer>>, DeError>where
S: RtaType,
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.
sourcepub fn get_attribute(&self, t: T) -> Option<&Rtattr<T, Buffer>>
pub fn get_attribute(&self, t: T) -> Option<&Rtattr<T, Buffer>>
Get nested attributes from a parsed handle.
sourcepub fn get_attr_payload_as<'b, R>(&'b self, attr: T) -> Result<R, DeError>where
R: FromBytes<'b>,
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
.
sourcepub fn get_attr_payload_as_with_len<'b, R>(
&'b self,
attr: T
) -> Result<R, DeError>where
R: FromBytesWithInput<'b, Input = usize>,
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
.