RawSpace

Trait RawSpace 

Source
pub trait RawSpace {
    type Key;
    type Value;

    // Required methods
    fn get(&self, head: &Self::Key) -> Option<&Self::Value>;
    fn get_mut(&mut self, head: &Self::Key) -> Option<&mut Self::Value>;
}
Expand description

The RawSpace trait defines the basic interface for any compatible stores used within the crate.

Required Associated Types§

Source

type Key

The type used to index into the storage structure.

Source

type Value

The type of values stored within the structure.

Required Methods§

Source

fn get(&self, head: &Self::Key) -> Option<&Self::Value>

returns the tail associated with the provided head, if it exists

Source

fn get_mut(&mut self, head: &Self::Key) -> Option<&mut Self::Value>

returns a mutable reference to the tail associated with the provided head, if it exists

Implementations on Foreign Types§

Source§

impl<K, V> RawSpace for HashMap<K, V>
where K: Hash + Eq,

Source§

type Key = K

Source§

type Value = V

Source§

fn get(&self, key: &Self::Key) -> Option<&Self::Value>

Source§

fn get_mut(&mut self, key: &Self::Key) -> Option<&mut Self::Value>

Source§

impl<T> RawSpace for Vec<T>

Source§

type Key = usize

Source§

type Value = T

Source§

fn get(&self, key: &Self::Key) -> Option<&Self::Value>

Source§

fn get_mut(&mut self, key: &Self::Key) -> Option<&mut Self::Value>

Implementors§