pub struct RateLimits { /* private fields */ }Expand description
Compiled per-(principal, bucket) limiter pool. Rules are evaluated in the order they appear in the JSON; the first match wins.
Implementations§
Source§impl RateLimits
impl RateLimits
pub fn from_json_str(s: &str) -> Result<Self, String>
Sourcepub fn active_limiter_count(&self) -> usize
pub fn active_limiter_count(&self) -> usize
v0.8.12 HIGH-11 fix: current per-(rule, principal, bucket)
limiter count. Surfaced for tests and the
rate_limit::active_limiters Prometheus gauge.
pub fn from_path(path: &Path) -> Result<Self, String>
Trait Implementations§
Source§impl Clone for RateLimits
impl Clone for RateLimits
Source§fn clone(&self) -> RateLimits
fn clone(&self) -> RateLimits
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 moreAuto Trait Implementations§
impl !RefUnwindSafe for RateLimits
impl !UnwindSafe for RateLimits
impl Freeze for RateLimits
impl Send for RateLimits
impl Sync for RateLimits
impl Unpin for RateLimits
impl UnsafeUnpin for RateLimits
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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