pub enum Value {
Integer(Integer),
Bytes(Vec<u8>),
Text(String),
Array(Vec<Value>),
Map(Map),
Uuid([u8; 16]),
Decimal {
exponent: Integer,
mantissa: Integer,
},
Bool(bool),
Null,
}Expand description
A value that canonical CBOR can encode.
Variants§
Integer(Integer)
An integer: major types 0 and 1.
Bytes(Vec<u8>)
A byte string: major type 2.
Text(String)
A text string: major type 3.
Array(Vec<Value>)
An array: major type 4.
Map(Map)
A map with integer or text keys: major type 5.
Uuid([u8; 16])
A UUID: tag 37 with a 16-byte byte string.
Decimal
A decimal fraction, mantissa × 10^exponent: tag 4 with an array of the two
integers. The precision is part of the value, so 1.5 and 1.50 are different values.
Bool(bool)
true or false.
Null
null.
Trait Implementations§
impl Eq for Value
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Forget for Value
impl Freeze for Value
impl Move for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnsafeUnpin for Value
impl UnwindSafe for Value
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