Trait vapcore_db::Readable [−][src]
Should be used to read values from database.
Required methods
fn read<T, R>(&self, col: u32, key: &dyn Key<T, Target = R>) -> Option<T> where
T: Decodable,
R: AsRef<[u8]>,
[src]
T: Decodable,
R: AsRef<[u8]>,
Returns value for given key.
fn exists<T, R>(&self, col: u32, key: &dyn Key<T, Target = R>) -> bool where
R: AsRef<[u8]>,
[src]
R: AsRef<[u8]>,
Returns true if given value exists.
Provided methods
fn read_with_cache<K, T, C>(
&self,
col: u32,
cache: &RwLock<C>,
key: &K
) -> Option<T> where
K: Key<T> + Eq + Hash + Clone,
T: Clone + Decodable,
C: Cache<K, T>,
[src]
&self,
col: u32,
cache: &RwLock<C>,
key: &K
) -> Option<T> where
K: Key<T> + Eq + Hash + Clone,
T: Clone + Decodable,
C: Cache<K, T>,
Returns value for given key either in cache or in database.
fn read_with_two_layer_cache<K, T, C>(
&self,
col: u32,
l1_cache: &RwLock<C>,
l2_cache: &RwLock<C>,
key: &K
) -> Option<T> where
K: Key<T> + Eq + Hash + Clone,
T: Clone + Decodable,
C: Cache<K, T>,
[src]
&self,
col: u32,
l1_cache: &RwLock<C>,
l2_cache: &RwLock<C>,
key: &K
) -> Option<T> where
K: Key<T> + Eq + Hash + Clone,
T: Clone + Decodable,
C: Cache<K, T>,
Returns value for given key either in two-layered cache or in database.
fn exists_with_cache<K, T, R, C>(
&self,
col: u32,
cache: &RwLock<C>,
key: &K
) -> bool where
K: Eq + Hash + Key<T, Target = R>,
R: AsRef<[u8]>,
C: Cache<K, T>,
[src]
&self,
col: u32,
cache: &RwLock<C>,
key: &K
) -> bool where
K: Eq + Hash + Key<T, Target = R>,
R: AsRef<[u8]>,
C: Cache<K, T>,
Returns true if given value exists either in cache or in database.