pub enum RateClass {
Rare,
Low,
Burst(u64),
Other(String),
}Expand description
The declared rate class of an events subject (RFC 04 §1.3, RFC 08 §5).
Not a Declared column, and the difference is the point: the vocabulary
is rare | low | burst(n/h), and the third is parameterized. Wrapping
it in Declared would file every legitimate burst(240/h) under
Other — the arm that means “a token this build does not know” — and lose
the budget in the process. So this carries its own Other, the shape
WireEncoding has had since v1.5.
Variants§
Rare
rare — at most one an hour; silence is the normal state.
Low
low — at most sixty an hour.
Burst(u64)
burst(n/h) — an explicit per-hour budget.
Other(String)
A spelling this build does not know, carried verbatim.
Implementations§
Source§impl RateClass
impl RateClass
Sourcepub fn parse(token: &str) -> RateClass
pub fn parse(token: &str) -> RateClass
Read a rate token. Unknown spellings are carried, not rejected —
this reads foreign slices (RFC 08 §6).
Sourcepub fn cap_per_hour(&self) -> Option<u64>
pub fn cap_per_hour(&self) -> Option<u64>
The declared ceiling in events per hour, where one is declared.
None for a spelling this build cannot read — which is not the same
as “no ceiling”, and callers must not treat it as unlimited.
Trait Implementations§
impl Eq for RateClass
impl StructuralPartialEq for RateClass
Auto Trait Implementations§
impl Freeze for RateClass
impl RefUnwindSafe for RateClass
impl Send for RateClass
impl Sync for RateClass
impl Unpin for RateClass
impl UnsafeUnpin for RateClass
impl UnwindSafe for RateClass
Blanket Implementations§
Source§impl<Source> AccessAs for Source
impl<Source> AccessAs for Source
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more