pub trait MetadataMapClientIp {
// Required methods
fn get_header_value_fmt(&self, key: &str) -> MetadataValueFmt<'_>;
fn extract_leftmost_forwarded_ip(&self) -> Option<IpAddr>;
fn extract_rightmost_forwarded_ip(&self) -> Option<IpAddr>;
fn extract_filtered_forwarded_ip(
&self,
filter: &impl Filter,
) -> Option<IpAddr>;
}Expand description
MetadataMap extension trait
Required Methods§
Sourcefn get_header_value_fmt(&self, key: &str) -> MetadataValueFmt<'_>
fn get_header_value_fmt(&self, key: &str) -> MetadataValueFmt<'_>
Retrieves FMT formatter for header value matching provided key
Sourcefn extract_leftmost_forwarded_ip(&self) -> Option<IpAddr>
fn extract_leftmost_forwarded_ip(&self) -> Option<IpAddr>
Extracts leftmost client IP with no assumption.
Note that this is generally not reliable as your client might be behind proxy
Prefer to use extract_client_ip_with by filtering out your proxies to find correct IP
Returns None if IP is not provided or obfuscated
Sourcefn extract_rightmost_forwarded_ip(&self) -> Option<IpAddr>
fn extract_rightmost_forwarded_ip(&self) -> Option<IpAddr>
Extracts rightmost client IP with no assumption.
Returns None if IP is not provided or obfuscated
Sourcefn extract_filtered_forwarded_ip(&self, filter: &impl Filter) -> Option<IpAddr>
fn extract_filtered_forwarded_ip(&self, filter: &impl Filter) -> Option<IpAddr>
Extracts client ip taking rightmost, after filtering out any IP matching filter
Returns None if IP is not provided or obfuscated
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.