pub struct Tlv {
pub tag: u8,
pub start: usize,
pub end: usize,
pub next: usize,
}Expand description
A tag-length-value element, with its contents located inside the input.
Fields§
§tag: u8§start: usizeOffset of the first content byte.
end: usizeOffset one past the last content byte.
next: usizeOffset one past the whole element, header included.
Implementations§
Source§impl Tlv
impl Tlv
pub fn contents<'a>(&self, data: &'a [u8]) -> &'a [u8] ⓘ
Sourcepub fn element<'a>(&self, data: &'a [u8], header_start: usize) -> &'a [u8] ⓘ
pub fn element<'a>(&self, data: &'a [u8], header_start: usize) -> &'a [u8] ⓘ
The element including its tag and length, which is what the keychain stores for a name.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
impl Copy for Tlv
impl Eq for Tlv
impl StructuralPartialEq for Tlv
Auto Trait Implementations§
impl Freeze for Tlv
impl RefUnwindSafe for Tlv
impl Send for Tlv
impl Sync for Tlv
impl Unpin for Tlv
impl UnsafeUnpin for Tlv
impl UnwindSafe for Tlv
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