pub trait IdempotencyStore:
Send
+ Sync
+ 'static {
// Required methods
fn claim<'a>(
&'a self,
key: &'a str,
ttl_secs: u64,
) -> Pin<Box<dyn Future<Output = IdempotencyDecision> + Send + 'a>>;
fn complete<'a>(
&'a self,
key: &'a str,
status: u16,
body: &'a [u8],
ttl_secs: u64,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'a>>;
fn release<'a>(
&'a self,
key: &'a str,
) -> Pin<Box<dyn Future<Output = ()> + Send + '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, ) -> Pin<Box<dyn Future<Output = IdempotencyDecision> + Send + 'a>>
fn complete<'a>( &'a self, key: &'a str, status: u16, body: &'a [u8], ttl_secs: u64, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'a>>
fn release<'a>( &'a self, key: &'a str, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'a>>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".