pub struct MemoryStore { /* private fields */ }Expand description
A FIFO data store that keeps items in memory.
Items are stored until fetched or until max_items is reached, at which point older items are removed to make space for new ones. The store maintains data in a queue structure and supports concurrent access.
When items are fetched, they are packaged into a JSON batch with metadata including:
- A batch array containing the items
- A timestamp indicating when the batch was created
- The store’s write key
Implementations§
Source§impl MemoryStore
impl MemoryStore
Sourcepub fn new(config: MemoryConfig) -> Self
pub fn new(config: MemoryConfig) -> Self
Creates a new MemoryStore with the specified configuration.
§Panics
- If max_fetch_size is less than 100 bytes
- If max_items is 0
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MemoryStore
impl RefUnwindSafe for MemoryStore
impl Send for MemoryStore
impl Sync for MemoryStore
impl Unpin for MemoryStore
impl UnwindSafe for MemoryStore
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