pub struct NoProxyMatcher { /* private fields */ }Expand description
Matcher for NO_PROXY / no_proxy environment variable patterns Supports patterns like:
- Exact domain matches: “example.com”
- Wildcard subdomain matches: “.example.com” (matches *.example.com)
- IP address exact matches: “192.168.1.1”
- IP/CIDR notation: “192.168.0.0/16”
- Special token “*”: matches everything (bypass all proxies)
Implementations§
Source§impl NoProxyMatcher
impl NoProxyMatcher
Sourcepub fn from_env_value(value: &str) -> Self
pub fn from_env_value(value: &str) -> Self
Create a new NoProxyMatcher from the value of NO_PROXY/no_proxy env var. The input is typically comma-separated list of patterns.
Sourcepub fn should_bypass(&self, target: &SocketAddr) -> bool
pub fn should_bypass(&self, target: &SocketAddr) -> bool
Check if a given target address should bypass the proxy (i.e., matches NO_PROXY).
Sourcepub fn should_bypass_hostname(&self, hostname: &str) -> bool
pub fn should_bypass_hostname(&self, hostname: &str) -> bool
Check if a hostname should bypass the proxy.
Auto Trait Implementations§
impl Freeze for NoProxyMatcher
impl RefUnwindSafe for NoProxyMatcher
impl Send for NoProxyMatcher
impl Sync for NoProxyMatcher
impl Unpin for NoProxyMatcher
impl UnsafeUnpin for NoProxyMatcher
impl UnwindSafe for NoProxyMatcher
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