pub struct Database {
pub raw: Arc<DB>,
/* private fields */
}
Fields§
§raw: Arc<DB>
Implementations§
Source§impl Database
impl Database
Sourcepub fn open<P: AsRef<Path>, I: IntoIterator<Item = ColumnFamilyDescriptor>>(
path: P,
options: &mut Options,
cfd: I,
) -> RocksResult<Self>
pub fn open<P: AsRef<Path>, I: IntoIterator<Item = ColumnFamilyDescriptor>>( path: P, options: &mut Options, cfd: I, ) -> RocksResult<Self>
Creates a database object and corresponding filesystem elements.
pub fn list_cf<P: AsRef<Path>>(path: P) -> RocksResult<Vec<String>>
pub fn list_cfamily(&self) -> RocksResult<Vec<String>>
pub fn get_cf(&self, name: &str) -> Option<Arc<BoundColumnFamily<'_>>>
Sourcepub fn cf_exists(&self, name: &str) -> bool
pub fn cf_exists(&self, name: &str) -> bool
Checks if column family with the given name exists.
Sourcepub fn create_cf(&self, name: &str) -> Result<Arc<BoundColumnFamily<'_>>>
pub fn create_cf(&self, name: &str) -> Result<Arc<BoundColumnFamily<'_>>>
Creates new column family.
Sourcepub fn drop_cf(&self, name: &str) -> RocksResult<()>
pub fn drop_cf(&self, name: &str) -> RocksResult<()>
Drop column family with a given name.
Sourcepub fn set(&self, cf_name: &str, key: &str, value: &[u8]) -> Result<()>
pub fn set(&self, cf_name: &str, key: &str, value: &[u8]) -> Result<()>
Set specified key value.
pub fn set_batch(&self, batch: WriteBatch) -> Result<()>
Sourcepub fn read_cf(
&self,
cf_name: &str,
) -> Result<DBIteratorWithThreadMode<'_, DBWithThreadMode<MultiThreaded>>>
pub fn read_cf( &self, cf_name: &str, ) -> Result<DBIteratorWithThreadMode<'_, DBWithThreadMode<MultiThreaded>>>
Get an iterator to read column family with a given name with IteratorMode::Start
.
Auto Trait Implementations§
impl Freeze for Database
impl RefUnwindSafe for Database
impl Send for Database
impl Sync for Database
impl Unpin for Database
impl UnwindSafe for Database
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