Struct Builder
pub struct Builder { /* private fields */ }
A builder to create a Matcher.
Construct with [Matcher::builder()].
Implementations
impl Builder
fn all<S>(self, val: S) -> Self where S: IntoValue,Set the target proxy for all destinations.
fn http<S>(self, val: S) -> Self where S: IntoValue,Set the target proxy for HTTP destinations.
fn https<S>(self, val: S) -> Self where S: IntoValue,Set the target proxy for HTTPS destinations.
fn no<S>(self, val: S) -> Self where S: IntoValue,Set the "no" proxy filter.
The rules are as follows:
- Entries are expected to be comma-separated (whitespace between entries is ignored)
- IP addresses (both IPv4 and IPv6) are allowed, as are optional subnet masks (by adding /size,
for example "
192.168.1.0/24"). - An entry "
*" matches all hostnames (this is the only wildcard allowed) - Any other entry is considered a domain name (and may contain a leading dot, for example
google.comand.google.comare equivalent) and would match both that domain AND all subdomains.
For example, if
"NO_PROXY=google.com, 192.168.1.0/24"was set, all of the following would match (and therefore would bypass the proxy):http://google.com/http://www.google.com/http://192.168.1.42/
The URL
http://notgoogle.com/would not match.fn build(self) -> MatcherConstruct a
Matcherusing the configured values.
Trait Implementations
impl Default for Builder
fn default() -> Builder
Auto Trait Implementations
impl Freeze for Builder
impl RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl UnsafeUnpin for Builder
impl UnwindSafe for Builder
Blanket Implementations
impl<T> Any for Builder
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for Builder
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Builder
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> From<T> for Builder
fn from(t: T) -> TReturns the argument unchanged.
impl<T> Instrument for Builder
impl<T> WithSubscriber for Builder
impl<T, U> Into<U> for Builder
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 Builder
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for Builder
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>