pub struct SimdTokenBucket { /* private fields */ }๐Deprecated since 0.8.1:
Experimental โ no SIMD benefit. Use TokenBucket instead.
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 UnsafeUnpin 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