Trait DataBase

Source
pub trait DataBase {
    // Required methods
    fn get<K: DbKey>(&self) -> Option<&K::Value>;
    fn put<K: DbKey>(&mut self, value: K::Value) -> Option<K::Value>;

    // Provided method
    fn get_cloned<K: DbKey>(&self) -> Option<K::Value>
       where K::Value: Clone { ... }
}

Required Methods§

Source

fn get<K: DbKey>(&self) -> Option<&K::Value>

Source

fn put<K: DbKey>(&mut self, value: K::Value) -> Option<K::Value>

Provided Methods§

Source

fn get_cloned<K: DbKey>(&self) -> Option<K::Value>
where K::Value: Clone,

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§