pub enum RateLimitSubject<'a> {
Ip(IpAddr),
WebId(&'a str),
Custom(&'a str),
}Expand description
Rate-limit subject — the entity whose quota is being counted.
Variants deliberately borrow &str / &IpAddr rather than owning;
the limiter computes a canonical string key at check time and drops
the borrow.
Variants§
Ip(IpAddr)
Anonymous client keyed by source IP.
WebId(&'a str)
Authenticated client keyed by WebID URL.
Custom(&'a str)
Opaque caller-supplied key (e.g. API-key fingerprint).
Trait Implementations§
Source§impl<'a> Clone for RateLimitSubject<'a>
impl<'a> Clone for RateLimitSubject<'a>
Source§fn clone(&self) -> RateLimitSubject<'a>
fn clone(&self) -> RateLimitSubject<'a>
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<'a> Debug for RateLimitSubject<'a>
impl<'a> Debug for RateLimitSubject<'a>
Source§impl<'a> PartialEq for RateLimitSubject<'a>
impl<'a> PartialEq for RateLimitSubject<'a>
Source§fn eq(&self, other: &RateLimitSubject<'a>) -> bool
fn eq(&self, other: &RateLimitSubject<'a>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<'a> Eq for RateLimitSubject<'a>
impl<'a> StructuralPartialEq for RateLimitSubject<'a>
Auto Trait Implementations§
impl<'a> Freeze for RateLimitSubject<'a>
impl<'a> RefUnwindSafe for RateLimitSubject<'a>
impl<'a> Send for RateLimitSubject<'a>
impl<'a> Sync for RateLimitSubject<'a>
impl<'a> Unpin for RateLimitSubject<'a>
impl<'a> UnsafeUnpin for RateLimitSubject<'a>
impl<'a> UnwindSafe for RateLimitSubject<'a>
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