Struct cbor_data::TaggedItem
source · 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 copy 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>
source§fn eq(&self, other: &TaggedItem<'a>) -> bool
fn eq(&self, other: &TaggedItem<'a>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.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