Trait bip_bencode::Dictionary [] [src]

pub trait Dictionary<'a, V> {
    fn to_list(&self) -> Vec<(&'a [u8], &V)>;
    fn lookup(&self, key: &[u8]) -> Option<&V>;
    fn lookup_mut(&mut self, key: &[u8]) -> Option<&mut V>;
    fn insert(&mut self, key: &'a [u8], value: V) -> Option<V>;
    fn remove(&mut self, key: &[u8]) -> Option<V>;
}

Trait for working with generic map data structures.

Required Methods

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

Lookup a value in the dictionary.

Lookup a mutable value in the dictionary.

Insert a key/value pair into the dictionary.

Remove a value from the dictionary and return it.

Implementors