pub struct Builder { /* private fields */ }
Expand description
Configuration builder of a redb Database.
Implementations§
source§impl Builder
impl Builder
sourcepub fn set_cache_size(&mut self, bytes: usize) -> &mut Self
pub fn set_cache_size(&mut self, bytes: usize) -> &mut Self
Set the amount of memory (in bytes) used for caching data
sourcepub fn create(&self, path: impl AsRef<Path>) -> Result<Database, DatabaseError>
pub fn create(&self, path: impl AsRef<Path>) -> Result<Database, DatabaseError>
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
sourcepub fn open(&self, path: impl AsRef<Path>) -> Result<Database, DatabaseError>
pub fn open(&self, path: impl AsRef<Path>) -> Result<Database, DatabaseError>
Opens an existing redb database.
sourcepub fn create_file(&self, file: File) -> Result<Database, DatabaseError>
pub fn create_file(&self, file: File) -> Result<Database, DatabaseError>
Open an existing or create a new database in the given file
.
The file must be empty or contain a valid database.
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§
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