pub struct DatabaseBuilder<O: Openable> { /* private fields */ }Expand description
Database builder
Implementations§
Source§impl<O: Openable> Builder<O>
impl<O: Openable> Builder<O>
Sourcepub fn open(self) -> Result<O>
pub fn open(self) -> Result<O>
Opens the database, creating it if it does not exist.
§Errors
Errors if an I/O error occurred, or if the database can not be opened.
Sourcepub fn journal_compression(self, comp: CompressionType) -> Self
pub fn journal_compression(self, comp: CompressionType) -> Self
Sets the compression type to use for large values that are written into the journal file.
Sourcepub fn manual_journal_persist(self, flag: bool) -> Self
pub fn manual_journal_persist(self, flag: bool) -> Self
If false, write batches or transactions automatically flush data to the operating system.
Default = false
Set to true to handle persistence manually, e.g. manually using PersistMode::SyncData for ACID transactions.
Sourcepub fn worker_threads(self, n: usize) -> Self
pub fn worker_threads(self, n: usize) -> Self
Sourcepub fn max_cached_files(self, n: Option<usize>) -> Self
pub fn max_cached_files(self, n: Option<usize>) -> Self
Sourcepub fn cache_size(self, size_bytes: u64) -> Self
pub fn cache_size(self, size_bytes: u64) -> Self
Sets the cache capacity in bytes.
It is recommended to configure the block cache capacity to be ~20-25% of the available memory - or more if the data set fully fits into memory.
Sourcepub fn max_journaling_size(self, bytes: u64) -> Self
pub fn max_journaling_size(self, bytes: u64) -> Self
Maximum size of all journals in bytes.
Default = 512 MiB
§Panics
Panics if < 64 MiB.
Same as max_total_wal_size in RocksDB.
Auto Trait Implementations§
impl<O> Freeze for Builder<O>
impl<O> RefUnwindSafe for Builder<O>where
O: RefUnwindSafe,
impl<O> Send for Builder<O>where
O: Send,
impl<O> Sync for Builder<O>where
O: Sync,
impl<O> Unpin for Builder<O>where
O: Unpin,
impl<O> UnwindSafe for Builder<O>where
O: UnwindSafe,
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