Struct Matcher

struct Matcher { ... }

A proxy matcher, usually built from environment variables.

Implementations

impl Matcher

fn from_env() -> Self

Create 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_proxy
  • HTTPS_PROXY/https_proxy
  • HTTP_PROXY/http_proxy
  • NO_PROXY/no_proxy
fn from_system() -> Self

Create 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-system feature is enabled, it will check more configuration. Use this constructor if you want to allow users to optionally enable more, or use from_env if you do not want the values to change based on an enabled feature.

fn builder() -> Builder

Start a builder to configure a matcher.

fn intercept(self: &Self, dst: &Uri) -> Option<Intercept>

Check if the destination should be intercepted by a proxy.

If the proxy rules match the destination, a new Uri will be returned to connect to.

impl Debug for Matcher

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

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

impl<T> Any for Matcher

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for Matcher

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for Matcher

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> From for Matcher

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Instrument for Matcher

impl<T> WithSubscriber for Matcher

impl<T, U> Into for Matcher

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for Matcher

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for Matcher

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>