dittolive_ditto::prelude

Trait CborValueGetters

Source
pub trait CborValueGetters {
    // Required methods
    fn as_array(&self) -> Option<&[CborValue]>;
    fn as_array_mut(&mut self) -> Option<&mut Vec<CborValue>>;
    fn as_bool(&self) -> Option<bool>;
    fn as_f64(&self) -> Option<f64>;
    fn as_i64(&self) -> Option<i64>;
    fn as_null(&self) -> Option<()>;
    fn as_object(&self) -> Option<&BTreeMap<CborValue, CborValue>>;
    fn as_object_mut(&mut self) -> Option<&mut BTreeMap<CborValue, CborValue>>;
    fn as_str(&self) -> Option<&str>;
    fn as_u64(&self) -> Option<u64>;
    fn get(&self, _: impl Index) -> Option<&CborValue>;
    fn get_mut(&mut self, _: impl Index) -> Option<&mut CborValue>;
}

Required Methods§

Source

fn as_array(&self) -> Option<&[CborValue]>

Source

fn as_array_mut(&mut self) -> Option<&mut Vec<CborValue>>

Source

fn as_bool(&self) -> Option<bool>

Source

fn as_f64(&self) -> Option<f64>

Source

fn as_i64(&self) -> Option<i64>

Source

fn as_null(&self) -> Option<()>

Source

fn as_object(&self) -> Option<&BTreeMap<CborValue, CborValue>>

Source

fn as_object_mut(&mut self) -> Option<&mut BTreeMap<CborValue, CborValue>>

Source

fn as_str(&self) -> Option<&str>

Source

fn as_u64(&self) -> Option<u64>

Source

fn get(&self, _: impl Index) -> Option<&CborValue>

Source

fn get_mut(&mut self, _: impl Index) -> Option<&mut CborValue>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§