pub struct InMemoryStore { /* private fields */ }
Expand description
Enhanced in-memory store with TTL, cleanup, and additional operations
Implementations§
Source§impl InMemoryStore
impl InMemoryStore
Sourcepub fn with_ttl(ttl_seconds: u64) -> Self
pub fn with_ttl(ttl_seconds: u64) -> Self
Create a new in-memory store with TTL (overloaded for tests)
Sourcepub fn with_capacity(max_entries: usize) -> Self
pub fn with_capacity(max_entries: usize) -> Self
Create a new in-memory store with capacity limit
Sourcepub fn with_ttl_and_capacity(ttl_seconds: u64, max_entries: usize) -> Self
pub fn with_ttl_and_capacity(ttl_seconds: u64, max_entries: usize) -> Self
Create a new in-memory store with both TTL and capacity limit
Sourcepub fn contains_key(&self, key: &str) -> bool
pub fn contains_key(&self, key: &str) -> bool
Check if an entry exists and is not expired
Sourcepub fn stats(&self) -> MemoryStats
pub fn stats(&self) -> MemoryStats
Get memory usage statistics
Trait Implementations§
Auto Trait Implementations§
impl Freeze for InMemoryStore
impl RefUnwindSafe for InMemoryStore
impl Send for InMemoryStore
impl Sync for InMemoryStore
impl Unpin for InMemoryStore
impl UnwindSafe for InMemoryStore
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> 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