Trait ethcore::db::Writable [−][src]
pub trait Writable { fn write<T, R>(
&mut self,
col: Option<u32>,
key: &Key<T, Target = R>,
value: &T
)
where
T: Encodable,
R: Deref<Target = [u8]>; fn delete<T, R>(&mut self, col: Option<u32>, key: &Key<T, Target = R>)
where
T: Encodable,
R: Deref<Target = [u8]>; fn write_with_cache<K, T, R>(
&mut self,
col: Option<u32>,
cache: &mut Cache<K, T>,
key: K,
value: T,
policy: CacheUpdatePolicy
)
where
K: Key<T, Target = R> + Hash + Eq,
T: Encodable,
R: Deref<Target = [u8]>, { ... } fn extend_with_cache<K, T, R>(
&mut self,
col: Option<u32>,
cache: &mut Cache<K, T>,
values: HashMap<K, T>,
policy: CacheUpdatePolicy
)
where
K: Key<T, Target = R> + Hash + Eq,
T: Encodable,
R: Deref<Target = [u8]>, { ... } fn extend_with_option_cache<K, T, R>(
&mut self,
col: Option<u32>,
cache: &mut Cache<K, Option<T>>,
values: HashMap<K, Option<T>>,
policy: CacheUpdatePolicy
)
where
K: Key<T, Target = R> + Hash + Eq,
T: Encodable,
R: Deref<Target = [u8]>, { ... } }
Should be used to write value into database.
Required Methods
fn write<T, R>(&mut self, col: Option<u32>, key: &Key<T, Target = R>, value: &T) where
T: Encodable,
R: Deref<Target = [u8]>,
T: Encodable,
R: Deref<Target = [u8]>,
Writes the value into the database.
fn delete<T, R>(&mut self, col: Option<u32>, key: &Key<T, Target = R>) where
T: Encodable,
R: Deref<Target = [u8]>,
T: Encodable,
R: Deref<Target = [u8]>,
Deletes key from the databse.
Provided Methods
fn write_with_cache<K, T, R>(
&mut self,
col: Option<u32>,
cache: &mut Cache<K, T>,
key: K,
value: T,
policy: CacheUpdatePolicy
) where
K: Key<T, Target = R> + Hash + Eq,
T: Encodable,
R: Deref<Target = [u8]>,
&mut self,
col: Option<u32>,
cache: &mut Cache<K, T>,
key: K,
value: T,
policy: CacheUpdatePolicy
) where
K: Key<T, Target = R> + Hash + Eq,
T: Encodable,
R: Deref<Target = [u8]>,
Writes the value into the database and updates the cache.
fn extend_with_cache<K, T, R>(
&mut self,
col: Option<u32>,
cache: &mut Cache<K, T>,
values: HashMap<K, T>,
policy: CacheUpdatePolicy
) where
K: Key<T, Target = R> + Hash + Eq,
T: Encodable,
R: Deref<Target = [u8]>,
&mut self,
col: Option<u32>,
cache: &mut Cache<K, T>,
values: HashMap<K, T>,
policy: CacheUpdatePolicy
) where
K: Key<T, Target = R> + Hash + Eq,
T: Encodable,
R: Deref<Target = [u8]>,
Writes the values into the database and updates the cache.
fn extend_with_option_cache<K, T, R>(
&mut self,
col: Option<u32>,
cache: &mut Cache<K, Option<T>>,
values: HashMap<K, Option<T>>,
policy: CacheUpdatePolicy
) where
K: Key<T, Target = R> + Hash + Eq,
T: Encodable,
R: Deref<Target = [u8]>,
&mut self,
col: Option<u32>,
cache: &mut Cache<K, Option<T>>,
values: HashMap<K, Option<T>>,
policy: CacheUpdatePolicy
) where
K: Key<T, Target = R> + Hash + Eq,
T: Encodable,
R: Deref<Target = [u8]>,
Writes and removes the values into the database and updates the cache.
Implementations on Foreign Types
impl Writable for DBTransaction
[src]
impl Writable for DBTransaction
fn write<T, R>(&mut self, col: Option<u32>, key: &Key<T, Target = R>, value: &T) where
T: Encodable,
R: Deref<Target = [u8]>,
[src]
fn write<T, R>(&mut self, col: Option<u32>, key: &Key<T, Target = R>, value: &T) where
T: Encodable,
R: Deref<Target = [u8]>,
fn delete<T, R>(&mut self, col: Option<u32>, key: &Key<T, Target = R>) where
T: Encodable,
R: Deref<Target = [u8]>,
[src]
fn delete<T, R>(&mut self, col: Option<u32>, key: &Key<T, Target = R>) where
T: Encodable,
R: Deref<Target = [u8]>,
fn write_with_cache<K, T, R>(
&mut self,
col: Option<u32>,
cache: &mut Cache<K, T>,
key: K,
value: T,
policy: CacheUpdatePolicy
) where
K: Key<T, Target = R> + Hash + Eq,
T: Encodable,
R: Deref<Target = [u8]>,
[src]
fn write_with_cache<K, T, R>(
&mut self,
col: Option<u32>,
cache: &mut Cache<K, T>,
key: K,
value: T,
policy: CacheUpdatePolicy
) where
K: Key<T, Target = R> + Hash + Eq,
T: Encodable,
R: Deref<Target = [u8]>,
fn extend_with_cache<K, T, R>(
&mut self,
col: Option<u32>,
cache: &mut Cache<K, T>,
values: HashMap<K, T>,
policy: CacheUpdatePolicy
) where
K: Key<T, Target = R> + Hash + Eq,
T: Encodable,
R: Deref<Target = [u8]>,
[src]
fn extend_with_cache<K, T, R>(
&mut self,
col: Option<u32>,
cache: &mut Cache<K, T>,
values: HashMap<K, T>,
policy: CacheUpdatePolicy
) where
K: Key<T, Target = R> + Hash + Eq,
T: Encodable,
R: Deref<Target = [u8]>,
fn extend_with_option_cache<K, T, R>(
&mut self,
col: Option<u32>,
cache: &mut Cache<K, Option<T>>,
values: HashMap<K, Option<T>>,
policy: CacheUpdatePolicy
) where
K: Key<T, Target = R> + Hash + Eq,
T: Encodable,
R: Deref<Target = [u8]>,
[src]
fn extend_with_option_cache<K, T, R>(
&mut self,
col: Option<u32>,
cache: &mut Cache<K, Option<T>>,
values: HashMap<K, Option<T>>,
policy: CacheUpdatePolicy
) where
K: Key<T, Target = R> + Hash + Eq,
T: Encodable,
R: Deref<Target = [u8]>,