BDictAccess

Trait BDictAccess 

Source
pub trait BDictAccess<K, V> {
    // Required methods
    fn to_list(&self) -> Vec<(&K, &V)>;
    fn lookup(&self, key: &[u8]) -> Option<&V>;
    fn lookup_mut(&mut self, key: &[u8]) -> Option<&mut V>;
    fn insert(&mut self, key: K, value: V) -> Option<V>;
    fn remove(&mut self, key: &[u8]) -> Option<V>;
}
Expand description

Trait for working with generic map data structures.

Required Methods§

Source

fn to_list(&self) -> Vec<(&K, &V)>

Convert the dictionary to an unordered list of key/value pairs.

Source

fn lookup(&self, key: &[u8]) -> Option<&V>

Lookup a value in the dictionary.

Source

fn lookup_mut(&mut self, key: &[u8]) -> Option<&mut V>

Lookup a mutable value in the dictionary.

Source

fn insert(&mut self, key: K, value: V) -> Option<V>

Insert a key/value pair into the dictionary.

Source

fn remove(&mut self, key: &[u8]) -> Option<V>

Remove a value from the dictionary and return it.

Implementations on Foreign Types§

Source§

impl<'a, V> BDictAccess<&'a [u8], V> for BTreeMap<&'a [u8], V>

Source§

fn to_list(&self) -> Vec<(&&'a [u8], &V)>

Source§

fn lookup(&self, key: &[u8]) -> Option<&V>

Source§

fn lookup_mut(&mut self, key: &[u8]) -> Option<&mut V>

Source§

fn insert(&mut self, key: &'a [u8], value: V) -> Option<V>

Source§

fn remove(&mut self, key: &[u8]) -> Option<V>

Source§

impl<'a, V> BDictAccess<Cow<'a, [u8]>, V> for BTreeMap<Cow<'a, [u8]>, V>

Source§

fn to_list(&self) -> Vec<(&Cow<'a, [u8]>, &V)>

Source§

fn lookup(&self, key: &[u8]) -> Option<&V>

Source§

fn lookup_mut(&mut self, key: &[u8]) -> Option<&mut V>

Source§

fn insert(&mut self, key: Cow<'a, [u8]>, value: V) -> Option<V>

Source§

fn remove(&mut self, key: &[u8]) -> Option<V>

Implementors§