[][src]Struct kvdb_rocksdb::Database

pub struct Database { /* fields omitted */ }

Key-Value database.

Methods

impl Database[src]

pub fn open_default(path: &str) -> Result<Database>[src]

Open database with default settings.

pub fn open(config: &DatabaseConfig, path: &str) -> Result<Database>[src]

Open database file. Creates if it does not exist.

pub fn transaction(&self) -> DBTransaction[src]

Helper to create new transaction for this database.

pub fn write_buffered(&self, tr: DBTransaction)[src]

Commit transaction to database.

pub fn flush(&self) -> Result<()>[src]

Commit buffered changes to database.

pub fn write(&self, tr: DBTransaction) -> Result<()>[src]

Commit transaction to database.

pub fn get(&self, col: Option<u32>, key: &[u8]) -> Result<Option<DBValue>>[src]

Get value by key.

pub fn get_by_prefix(
    &self,
    col: Option<u32>,
    prefix: &[u8]
) -> Option<Box<[u8]>>
[src]

Get value by partial key. Prefix size should match configured prefix size. Only searches flushed values.

pub fn iter<'a>(
    &'a self,
    col: Option<u32>
) -> impl Iterator<Item = (Box<[u8]>, Box<[u8]>)> + 'a
[src]

Get database iterator for flushed data. Will hold a lock until the iterator is dropped preventing the database from being closed.

pub fn restore(&self, new_db: &str) -> Result<()>[src]

Restore the database from a copy at given path.

pub fn num_columns(&self) -> u32[src]

The number of non-default column families.

pub fn drop_column(&self) -> Result<()>[src]

Drop a column family.

pub fn add_column(&self) -> Result<()>[src]

Add a column family.

Trait Implementations

impl Drop for Database[src]

impl KeyValueDB for Database[src]

Auto Trait Implementations

impl Send for Database

impl Sync for Database

impl Unpin for Database

impl UnwindSafe for Database

impl !RefUnwindSafe for Database

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = !

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T[src]