pub struct InMemoryStorageEngine { /* private fields */ }Expand description
In-memory storage engine wrapping Database<InMemoryBackend>.
Intended for testing. Data is not persisted across process restarts. The database handle is reference-counted; cloning this struct shares the same underlying database.
Implementations§
Source§impl InMemoryStorageEngine
impl InMemoryStorageEngine
Sourcepub fn open() -> Result<Self, EngineError>
pub fn open() -> Result<Self, EngineError>
Creates a new in-memory database.
§Errors
Returns EngineError::Open if the in-memory database cannot be created.
Sourcepub fn db(&self) -> Arc<Database<InMemoryBackend>>
pub fn db(&self) -> Arc<Database<InMemoryBackend>>
Returns a shared reference to the underlying database (via Arc::clone).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for InMemoryStorageEngine
impl !RefUnwindSafe for InMemoryStorageEngine
impl Send for InMemoryStorageEngine
impl Sync for InMemoryStorageEngine
impl Unpin for InMemoryStorageEngine
impl UnsafeUnpin for InMemoryStorageEngine
impl !UnwindSafe for InMemoryStorageEngine
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more