pub enum CborValue<'a> {
Array(Vec<Cow<'a, Cbor>>),
Dict(BTreeMap<Cow<'a, Cbor>, Cow<'a, Cbor>>),
Undefined,
Null,
Bool(bool),
Number(Number<'a>),
Timestamp {
unix_epoch: i64,
nanos: u32,
tz_sec_east: i32,
},
Str(Cow<'a, str>),
Bytes(Cow<'a, [u8]>),
Invalid,
Unknown,
}Expand description
Lifted navigation structure for a CborValue.
You can obtain this using Cbor::decode().
This will reference existing bytes as much as possible, but in some cases it
has to allocate, e.g. when some needed slices are not contiguous in the underlying
Cbor.
Variants§
Array(Vec<Cow<'a, Cbor>>)
Dict(BTreeMap<Cow<'a, Cbor>, Cow<'a, Cbor>>)
Undefined
Null
Bool(bool)
Number(Number<'a>)
Timestamp
Fields
Str(Cow<'a, str>)
Bytes(Cow<'a, [u8]>)
Invalid
Structural constraints for a tag are violated (like tag 0 on a number)
Unknown
Unknown tags are present, you may want to manually interpret the TaggedItem
Implementations§
source§impl<'a> CborValue<'a>
impl<'a> CborValue<'a>
pub fn new(item: TaggedItem<'a>) -> Self
pub fn make_static(self) -> CborValue<'static>
Trait Implementations§
source§impl<'a> PartialEq for CborValue<'a>
impl<'a> PartialEq for CborValue<'a>
impl<'a> StructuralPartialEq for CborValue<'a>
Auto Trait Implementations§
impl<'a> Freeze for CborValue<'a>
impl<'a> RefUnwindSafe for CborValue<'a>
impl<'a> Send for CborValue<'a>
impl<'a> Sync for CborValue<'a>
impl<'a> Unpin for CborValue<'a>
impl<'a> UnwindSafe for CborValue<'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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)