[−][src]Struct rocksdb::DB
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]
P: AsRef<Path>,
I: IntoIterator<Item = N>,
N: AsRef<str>,
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]
opts: &Options,
path: P,
cfs: I
) -> Result<DB, Error> where
P: AsRef<Path>,
I: IntoIterator<Item = ColumnFamilyDescriptor>,
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]
opts: &Options,
path: P
) -> Result<Vec<String>, Error>
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]
&self,
batch: WriteBatch,
writeopts: &WriteOptions
) -> Result<(), Error>
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]
&self,
key: K,
readopts: &ReadOptions
) -> Result<Option<DBVector>, Error>
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]
&self,
cf: ColumnFamily,
key: K,
readopts: &ReadOptions
) -> Result<Option<DBVector>, Error>
pub fn get_cf<K: AsRef<[u8]>>(
&self,
cf: ColumnFamily,
key: K
) -> Result<Option<DBVector>, Error>
[src]
&self,
cf: ColumnFamily,
key: K
) -> Result<Option<DBVector>, Error>
pub fn get_pinned_opt<K: AsRef<[u8]>>(
&self,
key: K,
readopts: &ReadOptions
) -> Result<Option<DBPinnableSlice>, Error>
[src]
&self,
key: K,
readopts: &ReadOptions
) -> Result<Option<DBPinnableSlice>, Error>
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]
&self,
key: K
) -> Result<Option<DBPinnableSlice>, Error>
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]
&self,
cf: ColumnFamily,
key: K,
readopts: &ReadOptions
) -> Result<Option<DBPinnableSlice>, Error>
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]
&self,
cf: ColumnFamily,
key: K
) -> Result<Option<DBPinnableSlice>, Error>
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]
&self,
name: N,
opts: &Options
) -> Result<ColumnFamily, Error>
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]
&self,
mode: IteratorMode,
readopts: &ReadOptions
) -> DBIterator
pub fn iterator_cf_opt(
&self,
cf_handle: ColumnFamily,
readopts: &ReadOptions,
mode: IteratorMode
) -> Result<DBIterator, Error>
[src]
&self,
cf_handle: ColumnFamily,
readopts: &ReadOptions,
mode: IteratorMode
) -> Result<DBIterator, Error>
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]
&self,
cf_handle: ColumnFamily,
mode: IteratorMode
) -> Result<DBIterator, Error>
pub fn full_iterator_cf(
&self,
cf_handle: ColumnFamily,
mode: IteratorMode
) -> Result<DBIterator, Error>
[src]
&self,
cf_handle: ColumnFamily,
mode: IteratorMode
) -> Result<DBIterator, Error>
pub fn prefix_iterator_cf<P: AsRef<[u8]>>(
&self,
cf_handle: ColumnFamily,
prefix: P
) -> Result<DBIterator, Error>
[src]
&self,
cf_handle: ColumnFamily,
prefix: P
) -> Result<DBIterator, Error>
pub fn raw_iterator(&self) -> DBRawIterator
[src]
pub fn raw_iterator_cf(
&self,
cf_handle: ColumnFamily
) -> Result<DBRawIterator, Error>
[src]
&self,
cf_handle: ColumnFamily
) -> Result<DBRawIterator, Error>
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]
&self,
key: K,
value: V,
writeopts: &WriteOptions
) -> Result<(), Error> where
K: AsRef<[u8]>,
V: AsRef<[u8]>,
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]
&self,
cf: ColumnFamily,
key: K,
value: V,
writeopts: &WriteOptions
) -> Result<(), Error> where
K: AsRef<[u8]>,
V: AsRef<[u8]>,
pub fn merge_opt<K, V>(
&self,
key: K,
value: V,
writeopts: &WriteOptions
) -> Result<(), Error> where
K: AsRef<[u8]>,
V: AsRef<[u8]>,
[src]
&self,
key: K,
value: V,
writeopts: &WriteOptions
) -> Result<(), Error> where
K: AsRef<[u8]>,
V: AsRef<[u8]>,
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]
&self,
cf: ColumnFamily,
key: K,
value: V,
writeopts: &WriteOptions
) -> Result<(), Error> where
K: AsRef<[u8]>,
V: AsRef<[u8]>,
pub fn delete_opt<K: AsRef<[u8]>>(
&self,
key: K,
writeopts: &WriteOptions
) -> Result<(), Error>
[src]
&self,
key: K,
writeopts: &WriteOptions
) -> Result<(), Error>
pub fn delete_cf_opt<K: AsRef<[u8]>>(
&self,
cf: ColumnFamily,
key: K,
writeopts: &WriteOptions
) -> Result<(), Error>
[src]
&self,
cf: ColumnFamily,
key: K,
writeopts: &WriteOptions
) -> Result<(), Error>
pub fn put<K, V>(&self, key: K, value: V) -> Result<(), Error> where
K: AsRef<[u8]>,
V: AsRef<[u8]>,
[src]
K: AsRef<[u8]>,
V: AsRef<[u8]>,
pub fn put_cf<K, V>(
&self,
cf: ColumnFamily,
key: K,
value: V
) -> Result<(), Error> where
K: AsRef<[u8]>,
V: AsRef<[u8]>,
[src]
&self,
cf: ColumnFamily,
key: K,
value: V
) -> Result<(), Error> where
K: AsRef<[u8]>,
V: AsRef<[u8]>,
pub fn merge<K, V>(&self, key: K, value: V) -> Result<(), Error> where
K: AsRef<[u8]>,
V: AsRef<[u8]>,
[src]
K: AsRef<[u8]>,
V: AsRef<[u8]>,
pub fn merge_cf<K, V>(
&self,
cf: ColumnFamily,
key: K,
value: V
) -> Result<(), Error> where
K: AsRef<[u8]>,
V: AsRef<[u8]>,
[src]
&self,
cf: ColumnFamily,
key: K,
value: V
) -> Result<(), Error> where
K: AsRef<[u8]>,
V: AsRef<[u8]>,
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]
&self,
cf: ColumnFamily,
key: K
) -> Result<(), Error>
pub fn compact_range<S: AsRef<[u8]>, E: AsRef<[u8]>>(
&self,
start: Option<S>,
end: Option<E>
)
[src]
&self,
start: Option<S>,
end: Option<E>
)
pub fn compact_range_cf<S: AsRef<[u8]>, E: AsRef<[u8]>>(
&self,
cf: ColumnFamily,
start: Option<S>,
end: Option<E>
)
[src]
&self,
cf: ColumnFamily,
start: Option<S>,
end: Option<E>
)
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]
&self,
cf: ColumnFamily,
name: &str
) -> Result<Option<String>, Error>
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]
&self,
cf: ColumnFamily,
name: &str
) -> Result<Option<u64>, Error>
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
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,