pub struct RateLimitKey(/* private fields */);Expand description
A rate-limit dimension key supplied by the host (RFC-008 §4).
The key should be derived from a trustworthy, non-spoofable signal.
It must never be the raw plaintext code or a user-display identifier.
The recommended shape is HMAC(purpose || 0x00 || ip_or_scope) or a
stable fingerprint that the host can compute without codlet.
Implementations§
Source§impl RateLimitKey
impl RateLimitKey
Sourcepub fn fingerprint(&self) -> &str
pub fn fingerprint(&self) -> &str
A privacy-safe fingerprint of the key, safe to include in audit events and metrics labels (RFC-012 §10.3). Currently the first 8 characters of the key; adapters may override with a hashed prefix.
Trait Implementations§
Source§impl Clone for RateLimitKey
impl Clone for RateLimitKey
Source§fn clone(&self) -> RateLimitKey
fn clone(&self) -> RateLimitKey
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 moreSource§impl Debug for RateLimitKey
impl Debug for RateLimitKey
impl Eq for RateLimitKey
Source§impl Hash for RateLimitKey
impl Hash for RateLimitKey
Source§impl PartialEq for RateLimitKey
impl PartialEq for RateLimitKey
Source§fn eq(&self, other: &RateLimitKey) -> bool
fn eq(&self, other: &RateLimitKey) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for RateLimitKey
Auto Trait Implementations§
impl Freeze for RateLimitKey
impl RefUnwindSafe for RateLimitKey
impl Send for RateLimitKey
impl Sync for RateLimitKey
impl Unpin for RateLimitKey
impl UnsafeUnpin for RateLimitKey
impl UnwindSafe for RateLimitKey
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