#[non_exhaustive]pub enum ProxyConfigSource {
Registry,
GroupPolicy,
WinHttpDefault,
SystemConfigurationSetup,
SystemConfigurationState,
GSettings,
Kioslaverc,
KioslavercEnv,
Portal,
Env,
}Expand description
Where a ProxyMode came from. ProxyConfig keeps all of them for explanation.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
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, so they are not a substitute for the answer but the answer itself, from a
store documented to hold the same settings, and nothing is recorded — except under
ProxySettingsPerUser = 0, where 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 meant something by it, so it is reported from
sources; acting on it would route through a proxy nothing
else 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 an
empty BypassRules — 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.
Trait Implementations§
Source§impl Clone for ProxyConfigSource
impl Clone for ProxyConfigSource
Source§fn clone(&self) -> ProxyConfigSource
fn clone(&self) -> ProxyConfigSource
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ProxyConfigSource
Source§impl Debug for ProxyConfigSource
impl Debug for ProxyConfigSource
impl Eq for ProxyConfigSource
Source§impl Hash for ProxyConfigSource
impl Hash for ProxyConfigSource
Source§impl Ord for ProxyConfigSource
impl Ord for ProxyConfigSource
Source§fn cmp(&self, other: &ProxyConfigSource) -> Ordering
fn cmp(&self, other: &ProxyConfigSource) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for ProxyConfigSource
impl PartialEq for ProxyConfigSource
Source§impl PartialOrd for ProxyConfigSource
impl PartialOrd for ProxyConfigSource
impl StructuralPartialEq for ProxyConfigSource
Auto Trait Implementations§
impl Freeze for ProxyConfigSource
impl RefUnwindSafe for ProxyConfigSource
impl Send for ProxyConfigSource
impl Sync for ProxyConfigSource
impl Unpin for ProxyConfigSource
impl UnsafeUnpin for ProxyConfigSource
impl UnwindSafe for ProxyConfigSource
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.