Skip to main content

StorageEngine

Struct StorageEngine 

Source
pub struct StorageEngine { /* private fields */ }

Implementations§

Source§

impl StorageEngine

Source

pub fn open_file(path: impl AsRef<Path>) -> Result<Self, StorageError>

Open (creating if absent) a single-file, on-disk database.

Source

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.

Source

pub fn begin_write(&self) -> Result<WriteTransaction, StorageError>

Source

pub fn begin_read(&self) -> Result<ReadTransaction, StorageError>

Source

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.

Source

pub fn backup_to(&self, path: impl AsRef<Path>) -> Result<(), StorageError>

Write a transactionally consistent copy of every MarsDB table to a new database file. The destination is created exclusively so an existing file is never silently overwritten.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.