Skip to main content

ReplayGuard

Trait ReplayGuard 

Source
pub trait ReplayGuard: Send + Sync {
    // Required method
    fn claim<'a>(
        &'a self,
        binding: &'a str,
        ttl: Duration,
    ) -> BoxFuture<'a, Result<bool, Box<dyn Error + Send + Sync>>>;
}
Expand description

Records verified requests so that each is accepted once.

Required Methods§

Source

fn claim<'a>( &'a self, binding: &'a str, ttl: Duration, ) -> BoxFuture<'a, Result<bool, Box<dyn Error + Send + Sync>>>

Claims binding for ttl: Ok(true) the first time, Ok(false) when already claimed.

The claim must be atomic across every verifier that shares the store. Unexpired claims must not be evicted: if the store cannot retain a new claim, return an error. Store errors fail verification closed and are preserved as the rejection source.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§