pub struct LocalRateLimiter { /* private fields */ }Implementations§
Source§impl LocalRateLimiter
impl LocalRateLimiter
pub fn new(policy: RateLimitPolicy) -> Result<Self, RateLimitError>
Trait Implementations§
Source§impl Clone for LocalRateLimiter
impl Clone for LocalRateLimiter
Source§fn clone(&self) -> LocalRateLimiter
fn clone(&self) -> LocalRateLimiter
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LocalRateLimiter
impl Debug for LocalRateLimiter
Source§impl RateLimiter for LocalRateLimiter
impl RateLimiter for LocalRateLimiter
fn acquire<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<AcquireResult, RateLimitError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn try_acquire<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<TryAcquireResult, RateLimitError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn peek<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<PeekResult, RateLimitError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Auto Trait Implementations§
impl Freeze for LocalRateLimiter
impl !RefUnwindSafe for LocalRateLimiter
impl Send for LocalRateLimiter
impl Sync for LocalRateLimiter
impl Unpin for LocalRateLimiter
impl UnsafeUnpin for LocalRateLimiter
impl !UnwindSafe for LocalRateLimiter
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