pub struct RedisLimiter { /* private fields */ }Implementations§
Source§impl RedisLimiter
impl RedisLimiter
pub fn new<'a>( redis_cli: RedisClient, key_prefix: &'a str, script_str: &'a str, ) -> Self
pub fn get_redis_key<'a>(&self, key: &'a str, interval: u32) -> String
Trait Implementations§
Source§impl Default for RedisLimiter
impl Default for RedisLimiter
Source§impl Limiter for RedisLimiter
impl Limiter for RedisLimiter
fn get_token_count<'a>(&self, key: &'a str, interval: u32) -> Option<u32>
fn consume<'a>( &self, args: Vec<(&'a str, u32, u32, u32)>, ) -> Result<(), RedisConsumeError>
fn consume_one<'a>( &self, key: &'a str, interval: u32, capacity: u32, n: u32, ) -> Result<(), RedisConsumeError>
Auto Trait Implementations§
impl Freeze for RedisLimiter
impl RefUnwindSafe for RedisLimiter
impl Send for RedisLimiter
impl Sync for RedisLimiter
impl Unpin for RedisLimiter
impl UnwindSafe for RedisLimiter
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