pub struct EventLog { /* private fields */ }Expand description
Idempotency ledger over request resolutions. Each request_id gets one
terminal accounting: the first resolution (a fired event or a timeout)
wins; any later one is a Admit::Duplicate. This is what stops a
slow-but-successful Result arriving after a timeout from being counted both
as a miss (trust debit) and a result.
Implementations§
Source§impl EventLog
impl EventLog
pub fn new() -> Self
Sourcepub fn resolve(&mut self, request_id: Uuid) -> Admit
pub fn resolve(&mut self, request_id: Uuid) -> Admit
Record the terminal resolution of a request. First call → Fresh; any
subsequent call for the same request_id → Duplicate.
pub fn is_resolved(&self, request_id: &Uuid) -> bool
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EventLog
impl RefUnwindSafe for EventLog
impl Send for EventLog
impl Sync for EventLog
impl Unpin for EventLog
impl UnsafeUnpin for EventLog
impl UnwindSafe for EventLog
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