Trait vapcore_db::Writable[][src]

pub trait Writable {
    fn write<T, R>(&mut self, col: u32, key: &dyn Key<T, Target = R>, value: &T)
    where
        T: Encodable,
        R: AsRef<[u8]>
;
fn delete<T, R>(&mut self, col: u32, key: &dyn Key<T, Target = R>)
    where
        T: Encodable,
        R: AsRef<[u8]>
; fn write_with_cache<K, T, R>(
        &mut self,
        col: u32,
        cache: &mut dyn Cache<K, T>,
        key: K,
        value: T,
        policy: CacheUpdatePolicy
    )
    where
        K: Key<T, Target = R> + Hash + Eq,
        T: Encodable,
        R: AsRef<[u8]>
, { ... }
fn extend_with_cache<K, T, R>(
        &mut self,
        col: u32,
        cache: &mut dyn Cache<K, T>,
        values: HashMap<K, T>,
        policy: CacheUpdatePolicy
    )
    where
        K: Key<T, Target = R> + Hash + Eq,
        T: Encodable,
        R: AsRef<[u8]>
, { ... }
fn extend_with_option_cache<K, T, R>(
        &mut self,
        col: u32,
        cache: &mut dyn Cache<K, Option<T>>,
        values: HashMap<K, Option<T>>,
        policy: CacheUpdatePolicy
    )
    where
        K: Key<T, Target = R> + Hash + Eq,
        T: Encodable,
        R: AsRef<[u8]>
, { ... } }

Should be used to write value into database.

Required methods

fn write<T, R>(&mut self, col: u32, key: &dyn Key<T, Target = R>, value: &T) where
    T: Encodable,
    R: AsRef<[u8]>, 
[src]

Writes the value into the database.

fn delete<T, R>(&mut self, col: u32, key: &dyn Key<T, Target = R>) where
    T: Encodable,
    R: AsRef<[u8]>, 
[src]

Deletes key from the database.

Loading content...

Provided methods

fn write_with_cache<K, T, R>(
    &mut self,
    col: u32,
    cache: &mut dyn Cache<K, T>,
    key: K,
    value: T,
    policy: CacheUpdatePolicy
) where
    K: Key<T, Target = R> + Hash + Eq,
    T: Encodable,
    R: AsRef<[u8]>, 
[src]

Writes the value into the database and updates the cache.

fn extend_with_cache<K, T, R>(
    &mut self,
    col: u32,
    cache: &mut dyn Cache<K, T>,
    values: HashMap<K, T>,
    policy: CacheUpdatePolicy
) where
    K: Key<T, Target = R> + Hash + Eq,
    T: Encodable,
    R: AsRef<[u8]>, 
[src]

Writes the values into the database and updates the cache.

fn extend_with_option_cache<K, T, R>(
    &mut self,
    col: u32,
    cache: &mut dyn Cache<K, Option<T>>,
    values: HashMap<K, Option<T>>,
    policy: CacheUpdatePolicy
) where
    K: Key<T, Target = R> + Hash + Eq,
    T: Encodable,
    R: AsRef<[u8]>, 
[src]

Writes and removes the values into the database and updates the cache.

Loading content...

Implementations on Foreign Types

impl Writable for DBTransaction[src]

Loading content...

Implementors

Loading content...