[][src]Struct rocksdb::DB

pub struct DB { /* fields omitted */ }

A RocksDB database.

See crate level documentation for a simple usage example.

Methods

impl DB[src]

pub fn open_default<P: AsRef<Path>>(path: P) -> Result<DB, Error>[src]

Open a database with default options.

pub fn open<P: AsRef<Path>>(opts: &Options, path: P) -> Result<DB, Error>[src]

Open the database with the specified options.

pub fn open_cf<P, I, N>(opts: &Options, path: P, cfs: I) -> Result<DB, Error> where
    P: AsRef<Path>,
    I: IntoIterator<Item = N>,
    N: AsRef<str>, 
[src]

Open a database with the given database options and column family names.

Column families opened using this function will be created with default Options.

pub fn open_cf_descriptors<P, I>(
    opts: &Options,
    path: P,
    cfs: I
) -> Result<DB, Error> where
    P: AsRef<Path>,
    I: IntoIterator<Item = ColumnFamilyDescriptor>, 
[src]

Open a database with the given database options and column family descriptors.

pub fn list_cf<P: AsRef<Path>>(
    opts: &Options,
    path: P
) -> Result<Vec<String>, Error>
[src]

pub fn destroy<P: AsRef<Path>>(opts: &Options, path: P) -> Result<(), Error>[src]

pub fn repair<P: AsRef<Path>>(opts: Options, path: P) -> Result<(), Error>[src]

pub fn path(&self) -> &Path[src]

pub fn flush_opt(&self, flushopts: &FlushOptions) -> Result<(), Error>[src]

Flush database memtable to SST files on disk (with options).

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

Flush database memtable to SST files on disk.

pub fn write_opt(
    &self,
    batch: WriteBatch,
    writeopts: &WriteOptions
) -> Result<(), Error>
[src]

pub fn write(&self, batch: WriteBatch) -> Result<(), Error>[src]

pub fn write_without_wal(&self, batch: WriteBatch) -> Result<(), Error>[src]

pub fn get_opt<K: AsRef<[u8]>>(
    &self,
    key: K,
    readopts: &ReadOptions
) -> Result<Option<DBVector>, Error>
[src]

pub fn get<K: AsRef<[u8]>>(&self, key: K) -> Result<Option<DBVector>, Error>[src]

Return the bytes associated with a key value

pub fn get_cf_opt<K: AsRef<[u8]>>(
    &self,
    cf: ColumnFamily,
    key: K,
    readopts: &ReadOptions
) -> Result<Option<DBVector>, Error>
[src]

pub fn get_cf<K: AsRef<[u8]>>(
    &self,
    cf: ColumnFamily,
    key: K
) -> Result<Option<DBVector>, Error>
[src]

pub fn get_pinned_opt<K: AsRef<[u8]>>(
    &self,
    key: K,
    readopts: &ReadOptions
) -> Result<Option<DBPinnableSlice>, Error>
[src]

Return the value associated with a key using RocksDB's PinnableSlice so as to avoid unnecessary memory copy.

pub fn get_pinned<K: AsRef<[u8]>>(
    &self,
    key: K
) -> Result<Option<DBPinnableSlice>, Error>
[src]

Return the value associated with a key using RocksDB's PinnableSlice so as to avoid unnecessary memory copy. Similar to get_pinned_opt but leverages default options.

pub fn get_pinned_cf_opt<K: AsRef<[u8]>>(
    &self,
    cf: ColumnFamily,
    key: K,
    readopts: &ReadOptions
) -> Result<Option<DBPinnableSlice>, Error>
[src]

Return the value associated with a key using RocksDB's PinnableSlice so as to avoid unnecessary memory copy. Similar to get_pinned_opt but allows specifying ColumnFamily

pub fn get_pinned_cf<K: AsRef<[u8]>>(
    &self,
    cf: ColumnFamily,
    key: K
) -> Result<Option<DBPinnableSlice>, Error>
[src]

Return the value associated with a key using RocksDB's PinnableSlice so as to avoid unnecessary memory copy. Similar to get_pinned_cf_opt but leverages default options.

pub fn create_cf<N: AsRef<str>>(
    &self,
    name: N,
    opts: &Options
) -> Result<ColumnFamily, Error>
[src]

pub fn drop_cf(&self, name: &str) -> Result<(), Error>[src]

pub fn cf_handle(&self, name: &str) -> Option<ColumnFamily>[src]

Return the underlying column family handle.

Important traits for DBIterator<'a>
pub fn iterator(&self, mode: IteratorMode) -> DBIterator[src]

Important traits for DBIterator<'a>
pub fn iterator_opt(
    &self,
    mode: IteratorMode,
    readopts: &ReadOptions
) -> DBIterator
[src]

pub fn iterator_cf_opt(
    &self,
    cf_handle: ColumnFamily,
    readopts: &ReadOptions,
    mode: IteratorMode
) -> Result<DBIterator, Error>
[src]

Opens an iterator using the provided ReadOptions. This is used when you want to iterate over a specific ColumnFamily with a modified ReadOptions

Important traits for DBIterator<'a>
pub fn full_iterator(&self, mode: IteratorMode) -> DBIterator[src]

Opens an iterator with set_total_order_seek enabled. This must be used to iterate across prefixes when set_memtable_factory has been called with a Hash-based implementation.

Important traits for DBIterator<'a>
pub fn prefix_iterator<P: AsRef<[u8]>>(&self, prefix: P) -> DBIterator[src]

pub fn iterator_cf(
    &self,
    cf_handle: ColumnFamily,
    mode: IteratorMode
) -> Result<DBIterator, Error>
[src]

pub fn full_iterator_cf(
    &self,
    cf_handle: ColumnFamily,
    mode: IteratorMode
) -> Result<DBIterator, Error>
[src]

pub fn prefix_iterator_cf<P: AsRef<[u8]>>(
    &self,
    cf_handle: ColumnFamily,
    prefix: P
) -> Result<DBIterator, Error>
[src]

pub fn raw_iterator(&self) -> DBRawIterator[src]

pub fn raw_iterator_cf(
    &self,
    cf_handle: ColumnFamily
) -> Result<DBRawIterator, Error>
[src]

pub fn snapshot(&self) -> Snapshot[src]

pub fn put_opt<K, V>(
    &self,
    key: K,
    value: V,
    writeopts: &WriteOptions
) -> Result<(), Error> where
    K: AsRef<[u8]>,
    V: AsRef<[u8]>, 
[src]

pub fn put_cf_opt<K, V>(
    &self,
    cf: ColumnFamily,
    key: K,
    value: V,
    writeopts: &WriteOptions
) -> Result<(), Error> where
    K: AsRef<[u8]>,
    V: AsRef<[u8]>, 
[src]

pub fn merge_opt<K, V>(
    &self,
    key: K,
    value: V,
    writeopts: &WriteOptions
) -> Result<(), Error> where
    K: AsRef<[u8]>,
    V: AsRef<[u8]>, 
[src]

pub fn merge_cf_opt<K, V>(
    &self,
    cf: ColumnFamily,
    key: K,
    value: V,
    writeopts: &WriteOptions
) -> Result<(), Error> where
    K: AsRef<[u8]>,
    V: AsRef<[u8]>, 
[src]

pub fn delete_opt<K: AsRef<[u8]>>(
    &self,
    key: K,
    writeopts: &WriteOptions
) -> Result<(), Error>
[src]

pub fn delete_cf_opt<K: AsRef<[u8]>>(
    &self,
    cf: ColumnFamily,
    key: K,
    writeopts: &WriteOptions
) -> Result<(), Error>
[src]

pub fn put<K, V>(&self, key: K, value: V) -> Result<(), Error> where
    K: AsRef<[u8]>,
    V: AsRef<[u8]>, 
[src]

pub fn put_cf<K, V>(
    &self,
    cf: ColumnFamily,
    key: K,
    value: V
) -> Result<(), Error> where
    K: AsRef<[u8]>,
    V: AsRef<[u8]>, 
[src]

pub fn merge<K, V>(&self, key: K, value: V) -> Result<(), Error> where
    K: AsRef<[u8]>,
    V: AsRef<[u8]>, 
[src]

pub fn merge_cf<K, V>(
    &self,
    cf: ColumnFamily,
    key: K,
    value: V
) -> Result<(), Error> where
    K: AsRef<[u8]>,
    V: AsRef<[u8]>, 
[src]

pub fn delete<K: AsRef<[u8]>>(&self, key: K) -> Result<(), Error>[src]

pub fn delete_cf<K: AsRef<[u8]>>(
    &self,
    cf: ColumnFamily,
    key: K
) -> Result<(), Error>
[src]

pub fn compact_range<S: AsRef<[u8]>, E: AsRef<[u8]>>(
    &self,
    start: Option<S>,
    end: Option<E>
)
[src]

pub fn compact_range_cf<S: AsRef<[u8]>, E: AsRef<[u8]>>(
    &self,
    cf: ColumnFamily,
    start: Option<S>,
    end: Option<E>
)
[src]

pub fn set_options(&self, opts: &[(&str, &str)]) -> Result<(), Error>[src]

pub fn property_value(&self, name: &str) -> Result<Option<String>, Error>[src]

Retrieves a RocksDB property by name.

For a full list of properties, see https://github.com/facebook/rocksdb/blob/08809f5e6cd9cc4bc3958dd4d59457ae78c76660/include/rocksdb/db.h#L428-L634

pub fn property_value_cf(
    &self,
    cf: ColumnFamily,
    name: &str
) -> Result<Option<String>, Error>
[src]

Retrieves a RocksDB property by name, for a specific column family.

For a full list of properties, see https://github.com/facebook/rocksdb/blob/08809f5e6cd9cc4bc3958dd4d59457ae78c76660/include/rocksdb/db.h#L428-L634

pub fn property_int_value(&self, name: &str) -> Result<Option<u64>, Error>[src]

Retrieves a RocksDB property and casts it to an integer.

For a full list of properties that return int values, see https://github.com/facebook/rocksdb/blob/08809f5e6cd9cc4bc3958dd4d59457ae78c76660/include/rocksdb/db.h#L654-L689

pub fn property_int_value_cf(
    &self,
    cf: ColumnFamily,
    name: &str
) -> Result<Option<u64>, Error>
[src]

Retrieves a RocksDB property for a specific column family and casts it to an integer.

For a full list of properties that return int values, see https://github.com/facebook/rocksdb/blob/08809f5e6cd9cc4bc3958dd4d59457ae78c76660/include/rocksdb/db.h#L654-L689

Trait Implementations

impl Drop for DB[src]

impl Sync for DB[src]

impl Send for DB[src]

impl Debug for DB[src]

Blanket Implementations

impl<T> From for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto 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 for T where
    T: ?Sized
[src]

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

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