pub struct Quota { /* private fields */ }Expand description
An upper or lower bound for metrics.
Implementations§
Source§impl Quota
impl Quota
Sourcepub fn new(bound: f64, upper: bool) -> Self
pub fn new(bound: f64, upper: bool) -> Self
Create a quota with the given bound and whether it is an upper bound.
Sourcepub fn upper_bound(upper_bound: f64) -> Self
pub fn upper_bound(upper_bound: f64) -> Self
Create an upper-bound quota.
Sourcepub fn lower_bound(lower_bound: f64) -> Self
pub fn lower_bound(lower_bound: f64) -> Self
Create a lower-bound quota.
Sourcepub fn is_upper_bound(&self) -> bool
pub fn is_upper_bound(&self) -> bool
Whether this quota is an upper bound.
Sourcepub fn acceptable(&self, value: f64) -> bool
pub fn acceptable(&self, value: f64) -> bool
Whether the given value is acceptable under this quota.
Trait Implementations§
impl Copy for Quota
impl Eq for Quota
Auto Trait Implementations§
impl Freeze for Quota
impl RefUnwindSafe for Quota
impl Send for Quota
impl Sync for Quota
impl Unpin for Quota
impl UnsafeUnpin for Quota
impl UnwindSafe for Quota
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more