pub struct TaggedItem<'a> { /* private fields */ }Expand description
Representation of a possibly tagged CBOR data item
You can obtain this representation using Cbor::tagged_item.
It holds an iterable representation of the tags, a decoded ItemKind
and a reference to the underlying bytes for the whole item. Since all these are shallow
references to existing data, this structure itself is Copy.
Implementations§
Source§impl<'a> TaggedItem<'a>
impl<'a> TaggedItem<'a>
pub fn new(cbor: &'a Cbor) -> Self
Sourcepub fn decode(self) -> CborValue<'a>
pub fn decode(self) -> CborValue<'a>
Interpret the CBOR item at a higher level
While kind gives you precise information on how the item is encoded,
this method interprets the tag-based encoding according to the standard, adding for example
big integers, decimals, and floats, or turning base64-encoded text strings into binary strings.
An iterator over the tags of this item
Trait Implementations§
Source§impl<'a> Clone for TaggedItem<'a>
impl<'a> Clone for TaggedItem<'a>
Source§fn clone(&self) -> TaggedItem<'a>
fn clone(&self) -> TaggedItem<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for TaggedItem<'a>
impl<'a> Debug for TaggedItem<'a>
Source§impl<'a> Display for TaggedItem<'a>
impl<'a> Display for TaggedItem<'a>
Source§impl<'a> PartialEq for TaggedItem<'a>
impl<'a> PartialEq for TaggedItem<'a>
impl<'a> Copy for TaggedItem<'a>
impl<'a> StructuralPartialEq for TaggedItem<'a>
Auto Trait Implementations§
impl<'a> Freeze for TaggedItem<'a>
impl<'a> RefUnwindSafe for TaggedItem<'a>
impl<'a> Send for TaggedItem<'a>
impl<'a> Sync for TaggedItem<'a>
impl<'a> Unpin for TaggedItem<'a>
impl<'a> UnwindSafe for TaggedItem<'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