Struct cbor_data::CborValue [−][src]
Expand description
Representation of a possibly tagged CBOR data item.
Fields
kind: ValueKind<'a>bytes: &'a [u8]Implementations
Strip off wrappers of CBOR item encoding: sees through byte strings with
TAG_CBOR_ITEM.
Get value all tags, from the outermost to the innermost
Try to interpret this value as a 64bit unsigned integer.
Currently does not check floats or big integers.
Try to interpret this value as a signed integer.
Currently does not check floats or big integers.
Try to interpret this value as a signed integer.
Currently does not check floats or big integers.
Try to interpret this value as a floating-point number.
TODO: add proper representations for the big number types supported by CBOR
Try to interpret this value as byte string.
This returns a Cow because it may need to allocate a vector when decoding base64 strings.
Try to interpret this value as string.
Returns None if the type is not a (byte) string or the bytes are not valid UTF-8. base64 encoded strings (TAG_BASE64 or TAG_BASE64URL) are not decoded but returned as they are (even when their binary decoded form is valid UTF-8).
Lift a representation from this CBOR item that turns arrays into vectors and dicts into BTreeMaps.
This method is mostly useful for diagnostics and tests.
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for CborValue<'a>impl<'a> UnwindSafe for CborValue<'a>Blanket Implementations
Mutably borrows from an owned value. Read more