Enum cbor_event::Value
source · [−]pub enum Value {
U64(u64),
I64(i64),
Bytes(Vec<u8>),
Text(String),
Array(Vec<Value>),
IArray(Vec<Value>),
Object(BTreeMap<ObjectKey, Value>),
IObject(BTreeMap<ObjectKey, Value>),
Tag(u64, Box<Value>),
Special(Special),
}Expand description
All possible CBOR supported values.
We advise not to use these objects as an intermediary representation before retrieving custom types as it is a slow and not memory efficient way to do so. However it is handy for debugging or reverse a given protocol.
Variants
U64(u64)
I64(i64)
Bytes(Vec<u8>)
Text(String)
Array(Vec<Value>)
IArray(Vec<Value>)
Object(BTreeMap<ObjectKey, Value>)
IObject(BTreeMap<ObjectKey, Value>)
Tag(u64, Box<Value>)
Special(Special)
Trait Implementations
sourceimpl Deserialize for Value
impl Deserialize for Value
sourcefn deserialize<R: BufRead>(raw: &mut Deserializer<R>) -> Result<Self>
fn deserialize<R: BufRead>(raw: &mut Deserializer<R>) -> Result<Self>
method to implement to deserialise an object from the given
Deserializer. Read more
sourceimpl PartialOrd<Value> for Value
impl PartialOrd<Value> for Value
sourcefn partial_cmp(&self, other: &Value) -> Option<Ordering>
fn partial_cmp(&self, other: &Value) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
sourceimpl Serialize for Value
impl Serialize for Value
fn serialize<'se, W: Write + Sized>(
&self,
serializer: &'se mut Serializer<W>
) -> Result<&'se mut Serializer<W>>
impl StructuralPartialEq for Value
Auto Trait Implementations
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more