pub struct InMemoryEntryStore { /* private fields */ }Expand description
In-memory EntryStore implementation backed by a HashMap.
Partitioned entries are stored in-memory using tokio::sync::Mutex.
Not suitable for production persistence — data is lost on drop.
Implementations§
Trait Implementations§
Source§impl Default for InMemoryEntryStore
impl Default for InMemoryEntryStore
Source§impl EntryStore for InMemoryEntryStore
impl EntryStore for InMemoryEntryStore
Source§fn append<'life0, 'async_trait>(
&'life0 self,
entry: Entry,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn append<'life0, 'async_trait>(
&'life0 self,
entry: Entry,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Append a new entry to the partition.
Source§fn query<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
partition: &'life1 str,
range: &'life2 TimeRange,
opts: &'life3 QueryOptions,
) -> Pin<Box<dyn Future<Output = Result<Vec<Entry>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn query<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
partition: &'life1 str,
range: &'life2 TimeRange,
opts: &'life3 QueryOptions,
) -> Pin<Box<dyn Future<Output = Result<Vec<Entry>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Query entries within a time range, sorted and limited.
Source§fn evict<'life0, 'life1, 'async_trait>(
&'life0 self,
partition: &'life1 str,
keep: usize,
) -> Pin<Box<dyn Future<Output = Result<usize, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn evict<'life0, 'life1, 'async_trait>(
&'life0 self,
partition: &'life1 str,
keep: usize,
) -> Pin<Box<dyn Future<Output = Result<usize, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Evict oldest entries, keeping only
keep most recent.
Returns the number of entries evicted.Auto Trait Implementations§
impl !Freeze for InMemoryEntryStore
impl !RefUnwindSafe for InMemoryEntryStore
impl Send for InMemoryEntryStore
impl Sync for InMemoryEntryStore
impl Unpin for InMemoryEntryStore
impl UnsafeUnpin for InMemoryEntryStore
impl UnwindSafe for InMemoryEntryStore
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