pub struct InMemoryIdempotencyStore { /* private fields */ }Expand description
In-memory reference IdempotencyStore backed by a HashMap
behind a Mutex for interior mutability through &self.
Suitable for tests and for single-process consumers who do not need durable replay protection.
Implementations§
Trait Implementations§
Source§impl Debug for InMemoryIdempotencyStore
impl Debug for InMemoryIdempotencyStore
Source§impl Default for InMemoryIdempotencyStore
impl Default for InMemoryIdempotencyStore
Source§fn default() -> InMemoryIdempotencyStore
fn default() -> InMemoryIdempotencyStore
Returns the “default value” for a type. Read more
Source§impl IdempotencyStore for InMemoryIdempotencyStore
impl IdempotencyStore for InMemoryIdempotencyStore
Source§fn get(&self, key: &IdempotencyKey) -> Option<LifecycleReceipt>
fn get(&self, key: &IdempotencyKey) -> Option<LifecycleReceipt>
Look up the prior receipt for
key, if any.Source§fn put(
&self,
key: &IdempotencyKey,
receipt: &LifecycleReceipt,
) -> Result<StoreOutcome, ReceiptError>
fn put( &self, key: &IdempotencyKey, receipt: &LifecycleReceipt, ) -> Result<StoreOutcome, ReceiptError>
Insert or replay-confirm
receipt under key. Implementations
must enforce the spec’s idempotency rule: Read moreAuto Trait Implementations§
impl !Freeze for InMemoryIdempotencyStore
impl RefUnwindSafe for InMemoryIdempotencyStore
impl Send for InMemoryIdempotencyStore
impl Sync for InMemoryIdempotencyStore
impl Unpin for InMemoryIdempotencyStore
impl UnsafeUnpin for InMemoryIdempotencyStore
impl UnwindSafe for InMemoryIdempotencyStore
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