pub enum RateLimitScope {
Subject {
user_id: String,
tenant_id: TenantId,
},
IpAddress {
ip: String,
},
FactorAttempt {
user_id: String,
tenant_id: TenantId,
factor_id: String,
},
Endpoint {
path: String,
method: String,
},
Custom {
key: String,
},
}Expand description
Rate limit scope for different types of operations
Variants§
Subject
Rate limit per subject (user)
IpAddress
Rate limit per IP address
FactorAttempt
Rate limit per factor and subject
Endpoint
Rate limit per API endpoint
Custom
Custom rate limit key
Trait Implementations§
Source§impl Clone for RateLimitScope
impl Clone for RateLimitScope
Source§fn clone(&self) -> RateLimitScope
fn clone(&self) -> RateLimitScope
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 RateLimitScope
impl Debug for RateLimitScope
Source§impl<'de> Deserialize<'de> for RateLimitScope
impl<'de> Deserialize<'de> for RateLimitScope
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for RateLimitScope
impl Display for RateLimitScope
Source§impl Hash for RateLimitScope
impl Hash for RateLimitScope
Source§impl PartialEq for RateLimitScope
impl PartialEq for RateLimitScope
Source§fn eq(&self, other: &RateLimitScope) -> bool
fn eq(&self, other: &RateLimitScope) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for RateLimitScope
impl Serialize for RateLimitScope
impl Eq for RateLimitScope
impl StructuralPartialEq for RateLimitScope
Auto Trait Implementations§
impl Freeze for RateLimitScope
impl RefUnwindSafe for RateLimitScope
impl Send for RateLimitScope
impl Sync for RateLimitScope
impl Unpin for RateLimitScope
impl UnsafeUnpin for RateLimitScope
impl UnwindSafe for RateLimitScope
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