pub struct RustcaskBuilder { /* private fields */ }Expand description
Simplifies configuration and creation of Rustcask instances.
§Example
let store = Rustcask::builder()
.set_sync_mode(true)
.open(rustcask_dir);Implementations§
Source§impl RustcaskBuilder
impl RustcaskBuilder
Sourcepub fn set_max_data_file_size(self, max_size: u64) -> Self
pub fn set_max_data_file_size(self, max_size: u64) -> Self
Sets the maximum data file size. When the active data file surpasses this size, it will be marked read-only and a new active data file will be created.
Sourcepub fn set_sync_mode(self, sync_mode: bool) -> Self
pub fn set_sync_mode(self, sync_mode: bool) -> Self
When sync mode is set to true, writes to the data file are fsync’ed before returning to the user. This guarantees that data is durable and persisted to disk immediately, at the expense of reduced performance
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RustcaskBuilder
impl RefUnwindSafe for RustcaskBuilder
impl Send for RustcaskBuilder
impl Sync for RustcaskBuilder
impl Unpin for RustcaskBuilder
impl UnwindSafe for RustcaskBuilder
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