pub struct SimdTokenBucket { /* private fields */ }Expand description
SIMD-optimized token bucket implementation
Implementations§
Trait Implementations§
Source§impl Algorithm for SimdTokenBucket
impl Algorithm for SimdTokenBucket
Source§fn check<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<RateLimitDecision>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn check<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<RateLimitDecision>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Checks if a request for the given key should be permitted. Read more
Source§fn check_with_cost<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
cost: u64,
) -> Pin<Box<dyn Future<Output = Result<RateLimitDecision>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn check_with_cost<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
cost: u64,
) -> Pin<Box<dyn Future<Output = Result<RateLimitDecision>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Checks if a request with the given cost should be permitted. Read more
Auto Trait Implementations§
impl Freeze for SimdTokenBucket
impl RefUnwindSafe for SimdTokenBucket
impl Send for SimdTokenBucket
impl Sync for SimdTokenBucket
impl Unpin for SimdTokenBucket
impl UnwindSafe for SimdTokenBucket
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