[][src]Enum cborg::value::types::Value

pub enum Value {
    Unsigned(u64),
    Negative(i64),
    ByteString(Vec<u8>),
    Utf8String(String),
    Array(Vec<Value>),
    Map(Vec<KeyVal>),
    Float(f64),
    Simple(Simple),
}

Variants

Unsigned(u64)
Negative(i64)
ByteString(Vec<u8>)
Utf8String(String)
Array(Vec<Value>)
Map(Vec<KeyVal>)
Float(f64)
Simple(Simple)

Methods

impl Value[src]

pub fn major(&self) -> u8[src]

pub fn get_uint(&self) -> Option<u64>[src]

pub fn get_neg(&self) -> Option<i64>[src]

pub fn get_float(&self) -> Option<f64>[src]

pub fn get_bytes(&self) -> Option<Vec<u8>>[src]

pub fn get_string(&self) -> Option<String>[src]

pub fn get_array(&self) -> Option<Vec<Value>>[src]

pub fn get_map(&self) -> Option<Vec<KeyVal>>[src]

pub fn get_hash_map(&self) -> Option<HashMap<Value, Value>>[src]

pub fn encode_compact(&self) -> Vec<u8>[src]

pub fn encode(&self) -> Vec<u8>[src]

Trait Implementations

impl FromValue for Value[src]

impl<U> ValueInto<U> for Value where
    U: FromValue
[src]

impl ToValue for Value[src]

impl From<u32> for Value[src]

impl From<u64> for Value[src]

impl From<i8> for Value[src]

impl From<i32> for Value[src]

impl From<i64> for Value[src]

impl From<Vec<u8>> for Value[src]

impl From<String> for Value[src]

impl<'_> From<&'_ str> for Value[src]

impl<T> From<Vec<T>> for Value where
    Value: From<T>, 
[src]

impl<K, V, S> From<HashMap<K, V, S>> for Value where
    Value: From<K>,
    Value: From<V>, 
[src]

impl<K, V> From<BTreeMap<K, V>> for Value where
    Value: From<K>,
    Value: From<V>, 
[src]

impl From<f32> for Value[src]

impl From<f64> for Value[src]

impl From<bool> for Value[src]

impl Clone for Value[src]

impl Eq for Value[src]

impl PartialEq<Value> for Value[src]

impl Display for Value[src]

impl Debug for Value[src]

impl TryFrom<Value> for u8[src]

type Error = ()

The type returned in the event of a conversion error.

impl<'_> TryFrom<&'_ Value> for u8[src]

type Error = ()

The type returned in the event of a conversion error.

impl Hash for Value[src]

Auto Trait Implementations

impl Send for Value

impl Sync for Value

impl Unpin for Value

impl UnwindSafe for Value

impl RefUnwindSafe for Value

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]