Skip to main content

ProxyConfigSource

Enum ProxyConfigSource 

Source
#[non_exhaustive]
pub enum ProxyConfigSource { Registry, GroupPolicy, WinHttpDefault, SystemConfigurationSetup, SystemConfigurationState, GSettings, Kioslaverc, KioslavercEnv, Portal, Env, ConnectivityManager, CfNetworkSystemSettings, }
Expand description

Where a ProxyMode came from. ProxyConfig keeps all of them for explanation.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Registry

The per-user WinINet settings, read through WinHttpGetIEProxyConfigForCurrentUser, which answers for the active connection, so a VPN or dial-up connectoid carrying its own proxy is what this reports while it is up. When that call fails the backend falls back to the plain HKCU\…\Internet Settings values, which are the LAN connection’s: the label is unchanged, the store behind it is not, and the two disagree exactly when a connectoid was in charge. This label alone does not say which of them answered.

ProxyConfig::fallbacks says it for the failures where it is a loss. When the call reports that no Internet Explorer proxy settings exist (the documented ERROR_FILE_NOT_FOUND), the plain values are read from the same account’s own hive. They are the answer itself, from a store documented to hold the same settings, and nothing is recorded, except under ProxySettingsPerUser = 0. Under that setting, Windows answers from the per-machine Connections blob instead and these per-user values are a store it is not reading. When it fails any other way, settings may have existed and gone unread, so this source appears in that list: the read did not learn the value it came for.

§

GroupPolicy

Group policy HKLM\Software\Policies\…\Internet Settings. Recorded but never effective, because Windows does not read the values this crate reads from that key: no administrative template shipped with Windows writes ProxyServer, ProxyEnable, AutoConfigURL or ProxyOverride there (C:\Windows\PolicyDefinitions\inetres.admx defines ProxySettingsPerUser and nothing else under it), and WinHttpGetIEProxyConfigForCurrentUser answers the same with those values present as with the key empty. An administrator who wrote one by hand may have meant it, so it is reported from sources; acting on it would route through a proxy no other component on the machine uses.

§

WinHttpDefault

WinHTTP machine defaults (netsh winhttp set proxy). Recorded but never effective: Microsoft scopes this store to service and middle-tier processes rather than ranking it against the per-user settings, so the crate does not rank it either. A consumer that is a service reads it from sources.

§

SystemConfigurationSetup

macOS Setup:/Network/Global/Proxies (configured; loses to State:, but is the effective mode when there is no State: scope to lose to).

§

SystemConfigurationState

macOS State:/Network/Global/Proxies (in effect; wins when both exist).

§

GSettings

GNOME org.gnome.system.proxy.

§

Kioslaverc

KDE kioslaverc.

§

KioslavercEnv

The process environment, read under the variable names a kioslaverc with ProxyType = 4 chose: httpProxy=MY_HTTP_VAR names the variable, not the proxy.

Separate from Env because only the store is shared: the naming rule is the file’s, so the two can be read on one machine and disagree. Merged under a single label they would both land in sources and ProxyConfig::source would answer with whichever came first, silently.

The precedence slot is still kioslaverc’s: a ProxyType = 4 file occupies the position any other ProxyType would, because the rule keys off the store that was read and not off the label it hands back.

§

Portal

XDG portal resolver. It answers already-resolved lookups, so a ProxyMode::Manual from this source always carries BypassRules with no entries and no implicit set (ImplicitBypass::Empty): the portal applied the bypass itself and never discloses it.

The lookup names a fixed reserved probe host and not the destination you are asking about, because the portal resolves per destination and a snapshot has none to give it. A host-side PAC that branches on the host name therefore answers about the probe: a ProxyMode::Direct from this source says the portal had no proxy for the probe, which is a weaker claim than the same value read out of a settings store.

§

Env

Process environment, under the *_proxy convention this crate reads directly (ProxyEnv). A kioslaverc that names its own variables reports KioslavercEnv instead.

§

ConnectivityManager

Android’s ConnectivityManager.getDefaultProxy(): the proxy of the default network, or the global one when set, as the Java framework hands it to every app. It is what java.net.ProxySelector.getDefault() routes by, so a bypass list is read with that selector’s rules rather than Chromium’s.

§

CfNetworkSystemSettings

iOS’s CFNetworkCopySystemProxySettings(): the proxy of the active network, keyed like macOS’s SystemConfigurationState.

Trait Implementations§

Source§

impl Clone for ProxyConfigSource

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ProxyConfigSource

Source§

impl Debug for ProxyConfigSource

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for ProxyConfigSource

Source§

impl Hash for ProxyConfigSource

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for ProxyConfigSource

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
Source§

impl PartialEq for ProxyConfigSource

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialOrd for ProxyConfigSource

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl StructuralPartialEq for ProxyConfigSource

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more