pub struct InMemoryEventQueue { /* private fields */ }Expand description
Bounded FIFO event buffer with Send + Sync access.
Capacity defaults to 10_000; oldest events are dropped past that.
Use PersistentEventQueue when
surviving process restart matters.
Implementations§
Source§impl InMemoryEventQueue
impl InMemoryEventQueue
pub fn new() -> Self
pub fn with_capacity(capacity: usize) -> Self
Trait Implementations§
Source§impl Debug for InMemoryEventQueue
impl Debug for InMemoryEventQueue
Source§impl Default for InMemoryEventQueue
impl Default for InMemoryEventQueue
Source§impl EventQueue for InMemoryEventQueue
impl EventQueue for InMemoryEventQueue
Source§fn push(&self, event: OwnedEvent)
fn push(&self, event: OwnedEvent)
Append an event to the tail. If the queue is at capacity,
the oldest entry is dropped (FIFO eviction).
Source§fn drain_batch(&self, n: usize) -> Vec<OwnedEvent>
fn drain_batch(&self, n: usize) -> Vec<OwnedEvent>
Take up to
n events from the head, removing them. Used by
adapter workers to assemble batches for HTTP transmission.Source§fn discard_all(&self)
fn discard_all(&self)
Drop everything without sending. Called on consent revocation
and on
UsageReporter::erase_remote_data. Implementations
MUST guarantee no buffered event escapes after this returns.Source§fn peek_recent(&self, n: usize) -> Vec<OwnedEvent>
fn peek_recent(&self, n: usize) -> Vec<OwnedEvent>
Snapshot the head of the queue (clone). Used by the
PrivacySettings “Inspect data sent” view. Best-effort — the
returned events may have been drained by the time the caller
reads them.fn is_empty(&self) -> bool
Auto Trait Implementations§
impl !Freeze for InMemoryEventQueue
impl RefUnwindSafe for InMemoryEventQueue
impl Send for InMemoryEventQueue
impl Sync for InMemoryEventQueue
impl Unpin for InMemoryEventQueue
impl UnsafeUnpin for InMemoryEventQueue
impl UnwindSafe for InMemoryEventQueue
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