pub struct CounterKey { /* private fields */ }Expand description
The complete logical identity of one stored rate-limit counter.
Backends must use both the policy configuration fingerprint and opaque subject key when comparing, ordering, locking, or persisting counters.
Implementations§
Source§impl CounterKey
impl CounterKey
Sourcepub const fn new(fingerprint: PolicyFingerprint, subject: SubjectKey) -> Self
pub const fn new(fingerprint: PolicyFingerprint, subject: SubjectKey) -> Self
Constructs a logical counter key from its fixed-width components.
Sourcepub const fn fingerprint(self) -> PolicyFingerprint
pub const fn fingerprint(self) -> PolicyFingerprint
Returns the policy configuration fingerprint.
Sourcepub const fn subject(self) -> SubjectKey
pub const fn subject(self) -> SubjectKey
Returns the opaque subject key.
Trait Implementations§
Source§impl Clone for CounterKey
impl Clone for CounterKey
Source§fn clone(&self) -> CounterKey
fn clone(&self) -> CounterKey
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 moreimpl Copy for CounterKey
Source§impl Debug for CounterKey
impl Debug for CounterKey
impl Eq for CounterKey
Source§impl Hash for CounterKey
impl Hash for CounterKey
Source§impl Ord for CounterKey
impl Ord for CounterKey
Source§fn cmp(&self, other: &CounterKey) -> Ordering
fn cmp(&self, other: &CounterKey) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for CounterKey
impl PartialEq for CounterKey
Source§impl PartialOrd for CounterKey
impl PartialOrd for CounterKey
impl StructuralPartialEq for CounterKey
Auto Trait Implementations§
impl Freeze for CounterKey
impl RefUnwindSafe for CounterKey
impl Send for CounterKey
impl Sync for CounterKey
impl Unpin for CounterKey
impl UnsafeUnpin for CounterKey
impl UnwindSafe for CounterKey
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