pub struct StorageEngine { /* private fields */ }Implementations§
Source§impl StorageEngine
impl StorageEngine
Sourcepub fn open_file(path: impl AsRef<Path>) -> Result<Self, StorageError>
pub fn open_file(path: impl AsRef<Path>) -> Result<Self, StorageError>
Open (creating if absent) a single-file, on-disk database.
Sourcepub fn open_memory() -> Result<Self, StorageError>
pub fn open_memory() -> Result<Self, StorageError>
Open a purely in-memory database. Nothing is written to disk and all
data is lost when the StorageEngine is dropped.
pub fn begin_write(&self) -> Result<WriteTransaction, StorageError>
pub fn begin_read(&self) -> Result<ReadTransaction, StorageError>
Sourcepub fn check_integrity(&mut self) -> Result<bool, StorageError>
pub fn check_integrity(&mut self) -> Result<bool, StorageError>
Run redb’s physical checksum/allocation integrity check. A false
result means damage was found and repaired; an unrecoverable database
is returned as an error.
Auto Trait Implementations§
impl !RefUnwindSafe for StorageEngine
impl !UnwindSafe for StorageEngine
impl Freeze for StorageEngine
impl Send for StorageEngine
impl Sync for StorageEngine
impl Unpin for StorageEngine
impl UnsafeUnpin for StorageEngine
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