pub struct InMemoryConsumedEnvelopeLedger { /* private fields */ }Expand description
The single-process ledger: a set. Exists so the obligation is testable here and so a caller with one process needs no ceremony; anything distributed brings its own implementation of the trait.
Trait Implementations§
Source§impl ConsumedEnvelopeLedger for InMemoryConsumedEnvelopeLedger
impl ConsumedEnvelopeLedger for InMemoryConsumedEnvelopeLedger
Source§fn spend(&mut self, envelope_id: &str) -> bool
fn spend(&mut self, envelope_id: &str) -> bool
Records
envelope_id as spent iff it was not already; returns whether
this call was the one that spent it. One atomic question, because
separate “seen?” and “record!” calls are a check-then-act race — two
concurrent presentations would both pass the check.Auto Trait Implementations§
impl Freeze for InMemoryConsumedEnvelopeLedger
impl RefUnwindSafe for InMemoryConsumedEnvelopeLedger
impl Send for InMemoryConsumedEnvelopeLedger
impl Sync for InMemoryConsumedEnvelopeLedger
impl Unpin for InMemoryConsumedEnvelopeLedger
impl UnsafeUnpin for InMemoryConsumedEnvelopeLedger
impl UnwindSafe for InMemoryConsumedEnvelopeLedger
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