pub struct TrustedProxyConfig { /* private fields */ }Expand description
Configuration holding the list of trusted networks.
Implementations§
Source§impl TrustedProxyConfig
impl TrustedProxyConfig
Sourcepub fn from_env(env_key: &str) -> Result<Self, String>
pub fn from_env(env_key: &str) -> Result<Self, String>
Loads configuration from an environment variable.
Expected format: “127.0.0.1;10.0.0.0/8;::1”
Sourcepub fn parse_str(input: &str) -> Result<Self, String>
pub fn parse_str(input: &str) -> Result<Self, String>
Parses a string separated by ; into trusted networks.
Sourcepub fn is_trusted(&self, ip: &IpAddr) -> bool
pub fn is_trusted(&self, ip: &IpAddr) -> bool
Checks if an IP is trusted.
Trait Implementations§
Source§impl Clone for TrustedProxyConfig
impl Clone for TrustedProxyConfig
Source§fn clone(&self) -> TrustedProxyConfig
fn clone(&self) -> TrustedProxyConfig
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 moreAuto Trait Implementations§
impl Freeze for TrustedProxyConfig
impl RefUnwindSafe for TrustedProxyConfig
impl Send for TrustedProxyConfig
impl Sync for TrustedProxyConfig
impl Unpin for TrustedProxyConfig
impl UnsafeUnpin for TrustedProxyConfig
impl UnwindSafe for TrustedProxyConfig
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