pub struct Builder { /* private fields */ }
Implementations
sourceimpl Builder
impl Builder
pub fn new() -> Self
pub fn set_write_strategy(&mut self, write_strategy: WriteStrategy) -> &mut Self
sourcepub fn set_initial_size(&mut self, size: u64) -> &mut Self
pub fn set_initial_size(&mut self, size: u64) -> &mut Self
The initial amount of usable space in bytes for the database
Databases grow dynamically, so it is generally unnecessary to set this. However, it can be used to avoid runtime overhead caused by resizing the database.
sourcepub unsafe fn create(&self, path: impl AsRef<Path>) -> Result<Database, Error>
pub unsafe fn create(&self, path: impl AsRef<Path>) -> Result<Database, Error>
Opens the specified file as a redb database.
- if the file does not exist, or is an empty file, a new database will be initialized in it
- if the file is a valid redb database, it will be opened
- otherwise this function will return an error
Safety
The file referenced by path
must not be concurrently modified by any other process
Auto Trait Implementations
impl RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl UnwindSafe for Builder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more