pub struct Element<'a> {
pub tag: Tag,
pub value: Value<'a>,
}Expand description
A tag and the value it labels.
Fields§
§tag: TagThe element’s tag; Tag::Anonymous when it has none.
value: Value<'a>The element’s value.
Implementations§
Source§impl<'a> Element<'a>
impl<'a> Element<'a>
Sourcepub fn unsigned(&self) -> Result<u64>
pub fn unsigned(&self) -> Result<u64>
The value as an unsigned integer, or ErrorCode::TlvWrongType.
Sourcepub fn signed(&self) -> Result<i64>
pub fn signed(&self) -> Result<i64>
The value as a signed integer, or ErrorCode::TlvWrongType.
Sourcepub fn bool(&self) -> Result<bool>
pub fn bool(&self) -> Result<bool>
The value as a boolean, or ErrorCode::TlvWrongType.
Sourcepub fn utf8(&self) -> Result<&'a str>
pub fn utf8(&self) -> Result<&'a str>
The value as a string, or ErrorCode::TlvWrongType.
Sourcepub fn octets(&self) -> Result<&'a [u8]>
pub fn octets(&self) -> Result<&'a [u8]>
The value as an octet string, or ErrorCode::TlvWrongType.
Trait Implementations§
impl<'a> Copy for Element<'a>
impl<'a> StructuralPartialEq for Element<'a>
Auto Trait Implementations§
impl<'a> Forget for Element<'a>
impl<'a> Freeze for Element<'a>
impl<'a> Move for Element<'a>
impl<'a> RefUnwindSafe for Element<'a>
impl<'a> Send for Element<'a>
impl<'a> Sync for Element<'a>
impl<'a> Unpin for Element<'a>
impl<'a> UnsafeUnpin for Element<'a>
impl<'a> UnwindSafe for Element<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more