//! The core Store seam and returned usage.
usestd::{future::Future,time::Duration};usesuper::RateLimitError;/// The operating mode to use when the rate-limit store fails.
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]pubenumStoreFailureMode{/// Build an error response without calling the inner service.
#[default]
Reject,/// Call the inner service without rate-limit metadata.
Allow,}/// The usage and reset duration returned by a store.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]pubstructUsage{/// Total charged requests in the current window, including this increment.
pubused:u64,
/// Time remaining until the current window resets.
pubreset_after: Duration,
}/// An asynchronous fixed-window rate-limit store.
pubtraitStore: Clone + Send + Sync + 'static {/// The concrete future returned by [`Store::increment`].
typeFuture:Future<Output = Result<Usage, RateLimitError>>+Send+'static;/// Atomically increment `key` for the fixed `window`.
fnincrement(&self, key:&str, window: Duration)->Self::Future;}