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§
Sourcefn get(&self, key: &str) -> RuntimeResult<Option<IdempotencyRecord>>
fn get(&self, key: &str) -> RuntimeResult<Option<IdempotencyRecord>>
Returns a stored record by key.
Sourcefn insert(&mut self, record: IdempotencyRecord) -> RuntimeResult<()>
fn insert(&mut self, record: IdempotencyRecord) -> RuntimeResult<()>
Inserts or replaces a validated record.
Provided Methods§
Sourcefn remove(&mut self, _key: &str) -> RuntimeResult<()>
fn remove(&mut self, _key: &str) -> RuntimeResult<()>
Removes a record when supported.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".