#[repr(u8)]pub enum HotStorage {
Memory(MemoryPrimitiveStorage),
Sqlite(SqlitePrimitiveStorage),
}Expand description
Hot storage tier.
Provides a single interface for hot tier storage operations, dispatching to either Memory or SQLite implementations.
Variants§
Memory(MemoryPrimitiveStorage)
In-memory storage (non-persistent)
Sqlite(SqlitePrimitiveStorage)
SQLite-based persistent storage
Implementations§
Source§impl HotStorage
impl HotStorage
Sourcepub fn sqlite_in_memory() -> Self
pub fn sqlite_in_memory() -> Self
Create a new SQLite backend with in-memory database
Sourcepub fn sqlite(config: SqliteConfig) -> Self
pub fn sqlite(config: SqliteConfig) -> Self
Create a new SQLite backend with the given configuration
Source§impl HotStorage
impl HotStorage
Sourcepub fn maintenance(&self)
pub fn maintenance(&self)
Run periodic maintenance (vacuum + shrink) to reclaim memory.
Trait Implementations§
Source§impl Clone for HotStorage
impl Clone for HotStorage
Source§fn clone(&self) -> HotStorage
fn clone(&self) -> HotStorage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl TierStorage for HotStorage
impl TierStorage for HotStorage
Source§fn get(
&self,
table: EntryKind,
key: &[u8],
version: CommitVersion,
) -> Result<Option<CowVec<u8>>>
fn get( &self, table: EntryKind, key: &[u8], version: CommitVersion, ) -> Result<Option<CowVec<u8>>>
Get the value for a key at or before the given version.
Source§fn contains(
&self,
table: EntryKind,
key: &[u8],
version: CommitVersion,
) -> Result<bool>
fn contains( &self, table: EntryKind, key: &[u8], version: CommitVersion, ) -> Result<bool>
Check if a key exists at or before the given version.
Source§fn set(
&self,
version: CommitVersion,
batches: HashMap<EntryKind, Vec<(CowVec<u8>, Option<CowVec<u8>>)>>,
) -> Result<()>
fn set( &self, version: CommitVersion, batches: HashMap<EntryKind, Vec<(CowVec<u8>, Option<CowVec<u8>>)>>, ) -> Result<()>
Write entries to multiple tables atomically at the given version. Read more
Source§fn range_next(
&self,
table: EntryKind,
cursor: &mut RangeCursor,
start: Bound<&[u8]>,
end: Bound<&[u8]>,
version: CommitVersion,
batch_size: usize,
) -> Result<RangeBatch>
fn range_next( &self, table: EntryKind, cursor: &mut RangeCursor, start: Bound<&[u8]>, end: Bound<&[u8]>, version: CommitVersion, batch_size: usize, ) -> Result<RangeBatch>
Fetch the next batch of entries in key order at or before version. Read more
Source§fn range_rev_next(
&self,
table: EntryKind,
cursor: &mut RangeCursor,
start: Bound<&[u8]>,
end: Bound<&[u8]>,
version: CommitVersion,
batch_size: usize,
) -> Result<RangeBatch>
fn range_rev_next( &self, table: EntryKind, cursor: &mut RangeCursor, start: Bound<&[u8]>, end: Bound<&[u8]>, version: CommitVersion, batch_size: usize, ) -> Result<RangeBatch>
Fetch the next batch of entries in reverse key order at or before version. Read more
Source§fn ensure_table(&self, table: EntryKind) -> Result<()>
fn ensure_table(&self, table: EntryKind) -> Result<()>
Ensure a table exists (creates if needed). Read more
impl TierBackend for HotStorage
Auto Trait Implementations§
impl Freeze for HotStorage
impl !RefUnwindSafe for HotStorage
impl Send for HotStorage
impl Sync for HotStorage
impl Unpin for HotStorage
impl UnsafeUnpin for HotStorage
impl !UnwindSafe for HotStorage
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