pub struct RateLimitKey(/* private fields */);Expand description
Opaque per-source bucket key for a RateLimiter.
Wraps a String so the underlying derivation strategy stays a hidden
implementation detail of whoever builds the key.
AuditEvent::rate_limit_key derives compound client_id_hint ‖ kid_hint keys per Phase 9 design call (e); future callers (Phase
10.11 nonce-store, OAuth callback PKCE throttle, etc) compose their
own keys from substrate-relevant fields.
Newtype (rather than passing &str through the limiter trait) lets
the type system prove that callers used the correct derivation —
stringly-typed keys would silently re-bucket on stray formatting
drift (whitespace, casing, separator choice).
Implementations§
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
Source§impl Display for RateLimitKey
impl Display for RateLimitKey
Source§impl From<&str> for RateLimitKey
impl From<&str> for RateLimitKey
Source§fn from(s: &str) -> RateLimitKey
fn from(s: &str) -> RateLimitKey
Converts to this type from the input type.
Source§impl From<String> for RateLimitKey
impl From<String> for RateLimitKey
Source§fn from(s: String) -> RateLimitKey
fn from(s: String) -> RateLimitKey
Converts to this type from the input type.
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 Eq for RateLimitKey
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.