speedbump 0.1.0

An extensible rate limiting library.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
pub mod memory;

use std::error::Error;

#[trait_variant::make(Store: Send)]
pub trait LocalStore<S> {
    type Error: Send + Sync + Error;

    async fn get(&self, key: &str) -> Result<Option<S>, Self::Error>;

    async fn set(&self, key: &str, state: S) -> Result<(), Self::Error>;

    async fn clear(&self, key: &str) -> Result<(), Self::Error>;
}