pub struct RocksDB {
pub config: Config,
pub write_opts: WriteOptions,
/* private fields */
}Fields§
§config: Config§write_opts: WriteOptionsImplementations§
Source§impl RocksDB
impl RocksDB
Sourcepub fn open_default(path: &str) -> Result<Self>
pub fn open_default(path: &str) -> Result<Self>
Open a rocksDB with default config.
pub fn close(&mut self)
Sourcepub fn restore(&mut self, new_db_path: &str) -> Result<()>
pub fn restore(&mut self, new_db_path: &str) -> Result<()>
Restore the database from a copy at given path.
pub fn iterator(&self, category: Option<DataCategory>) -> Option<DBIterator<'_>>
Trait Implementations§
Source§impl Database for RocksDB
impl Database for RocksDB
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)
fn flush(&self) -> Result<()>
impl Send for RocksDB
impl Sync for RocksDB
Auto Trait Implementations§
impl Freeze for RocksDB
impl RefUnwindSafe for RocksDB
impl Unpin for RocksDB
impl UnwindSafe for RocksDB
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more