pub struct MemoryStore<K> { /* private fields */ }
Available on crate feature memory-store only.
Expand description

A simple in-memory store for rate limiter.

Implementations§

Create a new MemoryStore.

Returns a Builder, which can builds a MemoryStore

Trait Implementations§

Error type for CacheStore.
Key
source§

fn load_entry<'life0, 'life1, 'async_trait, Q>(
    &'life0 self,
    key: &'life1 Q
) -> Pin<Box<dyn Future<Output = Option<CachedEntry>> + Send + 'async_trait>>where
    Self::Key: Borrow<Q>,
    Q: Hash + Eq + Sync + 'async_trait,
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,

Get the cache item from the store.
source§

fn save_entry<'life0, 'async_trait>(
    &'life0 self,
    key: Self::Key,
    entry: CachedEntry
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,

Save the cache item from the store.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more