[][src]Struct limitador::RateLimiter

pub struct RateLimiter { /* fields omitted */ }

Implementations

impl RateLimiter[src]

pub fn new() -> RateLimiter[src]

pub fn new_with_storage(storage: Box<dyn Storage>) -> RateLimiter[src]

pub fn get_namespaces(&self) -> Result<HashSet<Namespace>, LimitadorError>[src]

pub fn add_limit(&self, limit: &Limit) -> Result<(), LimitadorError>[src]

pub fn delete_limit(&self, limit: &Limit) -> Result<(), LimitadorError>[src]

pub fn get_limits(
    &self,
    namespace: impl Into<Namespace>
) -> Result<HashSet<Limit>, LimitadorError>
[src]

pub fn delete_limits(
    &self,
    namespace: impl Into<Namespace>
) -> Result<(), LimitadorError>
[src]

pub fn is_rate_limited(
    &self,
    namespace: impl Into<Namespace>,
    values: &HashMap<String, String>,
    delta: i64
) -> Result<bool, LimitadorError>
[src]

pub fn update_counters(
    &self,
    namespace: impl Into<Namespace>,
    values: &HashMap<String, String>,
    delta: i64
) -> Result<(), LimitadorError>
[src]

pub fn check_rate_limited_and_update(
    &self,
    namespace: impl Into<Namespace>,
    values: &HashMap<String, String>,
    delta: i64
) -> Result<bool, LimitadorError>
[src]

pub fn get_counters(
    &self,
    namespace: impl Into<Namespace>
) -> Result<HashSet<Counter>, LimitadorError>
[src]

pub fn configure_with(
    &self,
    limits: impl IntoIterator<Item = Limit>
) -> Result<(), LimitadorError>
[src]

Trait Implementations

impl Default for RateLimiter[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.