Struct Matcher
pub struct Matcher { /* private fields */ }
A proxy matcher, usually built from environment variables.
Implementations
impl Matcher
fn from_env() -> SelfCreate a matcher reading the current environment variables.
This checks for values in the following variables, treating them the same as curl does:
ALL_PROXY/all_proxyHTTPS_PROXY/https_proxyHTTP_PROXY/http_proxyNO_PROXY/no_proxy
fn from_system() -> SelfCreate a matcher from the environment or system.
This checks the same environment variables as
from_env(), and if not set, checks the system configuration for values for the OS.This constructor is always available, but if the
client-proxy-systemfeature is enabled, it will check more configuration. Use this constructor if you want to allow users to optionally enable more, or usefrom_envif you do not want the values to change based on an enabled feature.fn builder() -> BuilderStart a builder to configure a matcher.
fn intercept(&self, dst: &Uri) -> Option<Intercept>Check if the destination should be intercepted by a proxy.
If the proxy rules match the destination, a new
Uriwill be returned to connect to.
Trait Implementations
impl Debug for Matcher
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Auto Trait Implementations
impl !Freeze for Matcher
impl RefUnwindSafe for Matcher
impl Send for Matcher
impl Sync for Matcher
impl Unpin for Matcher
impl UnsafeUnpin for Matcher
impl UnwindSafe for Matcher
Blanket Implementations
impl<T> Any for Matcher
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for Matcher
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Matcher
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> From<T> for Matcher
fn from(t: T) -> TReturns the argument unchanged.
impl<T> Instrument for Matcher
impl<T> WithSubscriber for Matcher
impl<T, U> Into<U> for Matcher
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for Matcher
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for Matcher
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>