[][src]Trait hycon_rust::database::IDB

pub trait IDB {
type OptionType;
    fn get_default_option() -> Self::OptionType;
fn open(
        db_path: PathBuf,
        options: Option<Self::OptionType>
    ) -> Result<Self, Box<DBError>>
    where
        Self: Sized
;
fn destroy(db_path: PathBuf) -> Result<(), Box<DBError>>
    where
        Self: Sized
;
fn _get(&self, key: &[u8]) -> Result<Vec<u8>, Box<DBError>>;
fn set(&mut self, key: &[u8], value: &Vec<u8>) -> Result<(), Box<DBError>>;
fn delete(&mut self, key: &[u8]) -> Result<(), Box<DBError>>;
fn write_batch(
        &mut self,
        key_pairs: Vec<(Vec<u8>, Vec<u8>)>
    ) -> Result<(), Box<DBError>>; }

Associated Types

type OptionType

Loading content...

Required methods

fn get_default_option() -> Self::OptionType

fn open(
    db_path: PathBuf,
    options: Option<Self::OptionType>
) -> Result<Self, Box<DBError>> where
    Self: Sized

fn destroy(db_path: PathBuf) -> Result<(), Box<DBError>> where
    Self: Sized

fn _get(&self, key: &[u8]) -> Result<Vec<u8>, Box<DBError>>

fn set(&mut self, key: &[u8], value: &Vec<u8>) -> Result<(), Box<DBError>>

fn delete(&mut self, key: &[u8]) -> Result<(), Box<DBError>>

fn write_batch(
    &mut self,
    key_pairs: Vec<(Vec<u8>, Vec<u8>)>
) -> Result<(), Box<DBError>>

Loading content...

Implementations on Foreign Types

impl IDB for RocksDB[src]

type OptionType = RocksDBOptions

Loading content...

Implementors

impl IDB for RocksDBMock[src]

type OptionType = ()

Loading content...