pub enum Value {
UInt(u64),
Bytes(Vec<u8>),
Text(String),
Array(Vec<Value>),
Map(BTreeMap<Vec<u8>, Value>),
}Expand description
A canonical CBOR value. Use Value::map / Value::text / etc. to
build, then Value::encode to serialize.
Variants§
UInt(u64)
Major type 0: unsigned integer.
Bytes(Vec<u8>)
Major type 2: byte string.
Text(String)
Major type 3: UTF-8 text string.
Array(Vec<Value>)
Major type 4: definite-length array.
Map(BTreeMap<Vec<u8>, Value>)
Major type 5: definite-length map. Keys are sorted by their canonical encoded byte representation at serialize time.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze 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