Skip to main content

IdempotencyStore

Trait IdempotencyStore 

Source
pub trait IdempotencyStore: Send + Sync {
    // Required methods
    fn get(&self, key: &str) -> RuntimeResult<Option<IdempotencyRecord>>;
    fn insert(&mut self, record: IdempotencyRecord) -> RuntimeResult<()>;
    fn len(&self) -> usize;

    // Provided methods
    fn remove(&mut self, _key: &str) -> RuntimeResult<()> { ... }
    fn is_empty(&self) -> bool { ... }
}
Expand description

Durable or process-local idempotency record boundary.

Required Methods§

Source

fn get(&self, key: &str) -> RuntimeResult<Option<IdempotencyRecord>>

Returns a stored record by key.

Source

fn insert(&mut self, record: IdempotencyRecord) -> RuntimeResult<()>

Inserts or replaces a validated record.

Source

fn len(&self) -> usize

Returns the number of active records.

Provided Methods§

Source

fn remove(&mut self, _key: &str) -> RuntimeResult<()>

Removes a record when supported.

Source

fn is_empty(&self) -> bool

Reports whether no active records exist.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§