pub struct AccessCfg {
pub allow: Vec<String>,
pub deny: Vec<String>,
}Expand description
IP allow/deny lists, matched against the resolved client IP (the same IP rate limiting keys
on — so behind a trusted proxy, set server.trust_forwarded_for for this to see the real
client). Both lists accept plain IPs (203.0.113.7, ::1) and CIDR ranges
(10.0.0.0/8, 2001:db8::/32). deny wins over allow; a non-empty allow means
“only these may connect”. Both empty (the default) = allow all. Compiled into a
crate::access::AccessPolicy; an unparseable entry fails at startup/reload.
Fields§
§allow: Vec<String>CIDRs/IPs allowed in. Empty = allow all (subject to deny).
deny: Vec<String>CIDRs/IPs always rejected (takes precedence over allow).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AccessCfg
impl<'de> Deserialize<'de> for AccessCfg
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
Auto Trait Implementations§
impl Freeze for AccessCfg
impl RefUnwindSafe for AccessCfg
impl Send for AccessCfg
impl Sync for AccessCfg
impl Unpin for AccessCfg
impl UnsafeUnpin for AccessCfg
impl UnwindSafe for AccessCfg
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