pub trait HttpIdempotencyRepository: Send + Sync {
// Required methods
fn get(
&self,
tenant: &str,
key: &str,
expired_before: DateTime<Utc>,
) -> Result<Option<HttpIdempotencyRecord>>;
fn put(&self, record: &HttpIdempotencyRecord) -> Result<bool>;
fn purge_expired(&self, expired_before: DateTime<Utc>) -> Result<u64>;
}Expand description
Repository over the http_idempotency_keys table.
Required Methods§
Sourcefn get(
&self,
tenant: &str,
key: &str,
expired_before: DateTime<Utc>,
) -> Result<Option<HttpIdempotencyRecord>>
fn get( &self, tenant: &str, key: &str, expired_before: DateTime<Utc>, ) -> Result<Option<HttpIdempotencyRecord>>
Fetch the entry for (tenant, key).
Rows created strictly before expired_before are treated as expired:
they are deleted (lazy cleanup) and None is returned.
Sourcefn put(&self, record: &HttpIdempotencyRecord) -> Result<bool>
fn put(&self, record: &HttpIdempotencyRecord) -> Result<bool>
Insert a new entry. Returns false (without overwriting) when an entry
for (tenant, key) already exists — first write wins across replicas.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl HttpIdempotencyRepository for SqliteHttpIdempotencyRepository
Available on crate feature
sqlite only.