#[non_exhaustive]pub enum ProxyEntry {
Use(ProxyEndpoint),
Disabled,
Unusable(RejectedValue),
}Expand description
Whether a given Scheme uses a proxy at all.
Disabled distinguishes a scheme explicitly configured without a proxy from an
unconfigured scheme: it suppresses the Scheme::All fallback, while an unconfigured
scheme allows it. Unusable records a configured scheme whose proxy
could not be read. Absence means the platform has no setting for the scheme.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Use(ProxyEndpoint)
Route this scheme through the given proxy.
Disabled
The platform named this scheme and gave it no proxy: an off switch, or a slot left blank.
Unusable(RejectedValue)
The platform named this scheme and gave it a proxy that could not be read.
Routing requires an endpoint, which is unavailable here. Returning
Disabled would incorrectly treat an unreadable proxy setting as
a request for a direct connection. Under the resolve feature this becomes
Error::ProxyEntryUnusable.
Every lookup uses it only when no other entry covers the scheme; see
ProxyMode::entry_for. A usable Scheme::All
takes precedence because it supplies a usable configured fallback.
Implementations§
Source§impl ProxyEntry
impl ProxyEntry
Sourcepub fn endpoint(&self) -> Option<&ProxyEndpoint>
pub fn endpoint(&self) -> Option<&ProxyEndpoint>
Sourcepub fn is_disabled(&self) -> bool
pub fn is_disabled(&self) -> bool
Whether the entry is ProxyEntry::Disabled. false for
Unusable: a lost setting is not an off switch.
Sourcepub fn rejected(&self) -> Option<&RejectedValue>
pub fn rejected(&self) -> Option<&RejectedValue>
The drop record, for ProxyEntry::Unusable only.