pub struct RateLimiter { /* private fields */ }Implementations§
Source§impl RateLimiter
impl RateLimiter
pub fn new(config: RateLimitConfig) -> Self
pub fn check_and_record(&mut self, message_size: u64) -> Result<()>
pub fn check(&mut self, message_size: u64) -> bool
pub fn reset(&mut self)
pub fn get_stats(&self) -> RateLimitStats
pub fn get_config(&self) -> &RateLimitConfig
pub fn set_config(&mut self, config: RateLimitConfig)
Auto Trait Implementations§
impl Freeze for RateLimiter
impl RefUnwindSafe for RateLimiter
impl Send for RateLimiter
impl Sync for RateLimiter
impl Unpin for RateLimiter
impl UnwindSafe for RateLimiter
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