[][src]Trait cita_database::database::Database

pub trait Database: Send + Sync {
    fn get(
        &self,
        category: Option<DataCategory>,
        key: &[u8]
    ) -> Result<Option<Vec<u8>>>;
fn get_batch(
        &self,
        category: Option<DataCategory>,
        keys: &[Vec<u8>]
    ) -> Result<Vec<Option<Vec<u8>>>>;
fn insert(
        &self,
        category: Option<DataCategory>,
        key: Vec<u8>,
        value: Vec<u8>
    ) -> Result<()>;
fn insert_batch(
        &self,
        category: Option<DataCategory>,
        keys: Vec<Vec<u8>>,
        values: Vec<Vec<u8>>
    ) -> Result<()>;
fn contains(
        &self,
        category: Option<DataCategory>,
        key: &[u8]
    ) -> Result<bool>;
fn remove(&self, category: Option<DataCategory>, key: &[u8]) -> Result<()>;
fn remove_batch(
        &self,
        category: Option<DataCategory>,
        keys: &[Vec<u8>]
    ) -> Result<()>;
fn restore(&mut self, new_db: &str) -> Result<()>;
fn iterator(&self, category: Option<DataCategory>) -> Option<DBIterator>;
fn close(&mut self); }

Required methods

fn get(
    &self,
    category: Option<DataCategory>,
    key: &[u8]
) -> Result<Option<Vec<u8>>>

fn get_batch(
    &self,
    category: Option<DataCategory>,
    keys: &[Vec<u8>]
) -> Result<Vec<Option<Vec<u8>>>>

fn insert(
    &self,
    category: Option<DataCategory>,
    key: Vec<u8>,
    value: Vec<u8>
) -> Result<()>

fn insert_batch(
    &self,
    category: Option<DataCategory>,
    keys: Vec<Vec<u8>>,
    values: Vec<Vec<u8>>
) -> Result<()>

fn contains(&self, category: Option<DataCategory>, key: &[u8]) -> Result<bool>

fn remove(&self, category: Option<DataCategory>, key: &[u8]) -> Result<()>

fn remove_batch(
    &self,
    category: Option<DataCategory>,
    keys: &[Vec<u8>]
) -> Result<()>

fn restore(&mut self, new_db: &str) -> Result<()>

fn iterator(&self, category: Option<DataCategory>) -> Option<DBIterator>

fn close(&mut self)

Loading content...

Implementors

impl Database for MemoryDB[src]

impl Database for RocksDB[src]

Loading content...