pub trait IdempotencyStore:
Send
+ Sync
+ 'static {
// Required methods
fn claim<'a>(
&'a self,
key: &'a str,
ttl_secs: u64,
) -> BoxFuture<'a, IdempotencyDecision>;
fn complete<'a>(
&'a self,
key: &'a str,
status: u16,
body: &'a [u8],
ttl_secs: u64,
) -> BoxFuture<'a, ()>;
fn release<'a>(&'a self, key: &'a str) -> BoxFuture<'a, ()>;
}Expand description
App-provided storage (Redis SET NX PX in production).
Required Methods§
fn claim<'a>( &'a self, key: &'a str, ttl_secs: u64, ) -> BoxFuture<'a, IdempotencyDecision>
fn complete<'a>( &'a self, key: &'a str, status: u16, body: &'a [u8], ttl_secs: u64, ) -> BoxFuture<'a, ()>
fn release<'a>(&'a self, key: &'a str) -> BoxFuture<'a, ()>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".