pub struct Database { /* private fields */ }
Implementations
sourceimpl Database
impl Database
sourcepub unsafe fn create(
path: impl AsRef<Path>,
db_size: usize
) -> Result<Database, Error>
pub unsafe fn create(
path: impl AsRef<Path>,
db_size: usize
) -> 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
db_size
: the maximum size in bytes of the database.
Safety
The file referenced by path
must not be concurrently modified by any other process
sourcepub unsafe fn open(path: impl AsRef<Path>) -> Result<Database, Error>
pub unsafe fn open(path: impl AsRef<Path>) -> Result<Database, Error>
Opens an existing redb database.
Safety
The file referenced by path
must not be concurrently modified by any other process
pub fn builder() -> DatabaseBuilder
pub fn begin_write(&self) -> Result<WriteTransaction<'_>, Error>
pub fn begin_read(&self) -> Result<ReadTransaction<'_>, Error>
pub fn stats(&self) -> Result<DatabaseStats, Error>
pub fn print_debug(&self)
Auto Trait Implementations
impl RefUnwindSafe for Database
impl Send for Database
impl Sync for Database
impl Unpin for Database
impl UnwindSafe for Database
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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