pub struct InMemoryReplayStore { /* private fields */ }Expand description
A HashMap-backed ReplayStore for tests and single-process deployments.
Expired entries are lazily swept on each call rather than on a background timer — fine for a single process, but this does not share state across processes. Use a distributed store (e.g. Redis) for anything with more than one verifier instance.
Implementations§
Trait Implementations§
Source§impl Default for InMemoryReplayStore
impl Default for InMemoryReplayStore
Source§fn default() -> InMemoryReplayStore
fn default() -> InMemoryReplayStore
Returns the “default value” for a type. Read more
Source§impl ReplayStore for InMemoryReplayStore
impl ReplayStore for InMemoryReplayStore
Source§fn put_if_absent<'life0, 'life1, 'async_trait>(
&'life0 self,
jti: &'life1 str,
ttl: Duration,
) -> Pin<Box<dyn Future<Output = Result<bool, ReplayError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn put_if_absent<'life0, 'life1, 'async_trait>(
&'life0 self,
jti: &'life1 str,
ttl: Duration,
) -> Pin<Box<dyn Future<Output = Result<bool, ReplayError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Atomically records
jti if and only if it is not already present. Read moreAuto Trait Implementations§
impl !Freeze for InMemoryReplayStore
impl RefUnwindSafe for InMemoryReplayStore
impl Send for InMemoryReplayStore
impl Sync for InMemoryReplayStore
impl Unpin for InMemoryReplayStore
impl UnsafeUnpin for InMemoryReplayStore
impl UnwindSafe for InMemoryReplayStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more