pub struct RateLimitConfig {
pub redis_url: Secret<String>,
pub identity: RateLimitScopeConfig,
pub ip: RateLimitScopeConfig,
pub fail_mode: RateLimitFailMode,
pub trusted_proxy_hops: usize,
pub key_prefix: String,
}Expand description
Shared Redis-backed identity and client-IP rate-limit configuration.
Environment overrides use the standard nested naming convention, for
example <PREFIX>__RATE_LIMIT__REDIS_URL and
<PREFIX>__RATE_LIMIT__IDENTITY__REQUESTS_PER_PERIOD.
Fields§
§redis_url: Secret<String>Redis connection URL. Debug and display formatting redact its value.
identity: RateLimitScopeConfigAuthenticated-principal scope, intentionally lower than the IP net.
ip: RateLimitScopeConfigClient-IP safety-net scope.
fail_mode: RateLimitFailModeBehavior when the backing store cannot make a decision.
trusted_proxy_hops: usizeNumber of trusted reverse-proxy hops, including the socket peer.
key_prefix: StringPrefix prepended to all Redis and in-memory keys.
Trait Implementations§
Source§impl Clone for RateLimitConfig
impl Clone for RateLimitConfig
Source§impl Debug for RateLimitConfig
impl Debug for RateLimitConfig
Source§impl Default for RateLimitConfig
impl Default for RateLimitConfig
Source§impl<'de> Deserialize<'de> for RateLimitConfigwhere
RateLimitConfig: Default,
impl<'de> Deserialize<'de> for RateLimitConfigwhere
RateLimitConfig: Default,
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 Validate for RateLimitConfig
impl Validate for RateLimitConfig
Auto Trait Implementations§
impl Freeze for RateLimitConfig
impl RefUnwindSafe for RateLimitConfig
impl Send for RateLimitConfig
impl Sync for RateLimitConfig
impl Unpin for RateLimitConfig
impl UnsafeUnpin for RateLimitConfig
impl UnwindSafe for RateLimitConfig
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