pub enum Proxy {
Inherit,
Direct,
Url(String),
Invalid,
}Expand description
Effective proxy for one request (effectiveProxyURL + proxyutil.Parse).
Variants§
Inherit
Nothing configured.
Direct
direct / none: bypass every proxy, including environment ones.
Url(String)
http, https, socks5 or socks5h URL, as configured.
Invalid
Unparseable or unsupported: Go logs it and behaves as if none were configured.
Implementations§
Source§impl Proxy
impl Proxy
pub fn parse(raw: &str) -> Self
Sourcepub fn effective(credential: &Credential, cfg: &Config) -> Self
pub fn effective(credential: &Credential, cfg: &Config) -> Self
Credential proxy_url (attribute, then file metadata), then requests.proxy-url.
Sourcepub fn effective_url(credential: &Credential, cfg: &Config) -> String
pub fn effective_url(credential: &Credential, cfg: &Config) -> String
The setting effective parses, trimmed (Go proxyURLForAuth).
Sourcepub fn apply(
&self,
builder: ClientBuilder,
inherit_env: bool,
) -> Result<ClientBuilder>
pub fn apply( &self, builder: ClientBuilder, inherit_env: bool, ) -> Result<ClientBuilder>
Applies this proxy to a client. inherit_env mirrors Go’s standard transport,
which honours environment proxies when nothing is configured; the Claude uTLS
transports dial directly instead.
Trait Implementations§
impl Eq for Proxy
impl StructuralPartialEq for Proxy
Auto Trait Implementations§
impl Forget for Proxy
impl Freeze for Proxy
impl Move for Proxy
impl RefUnwindSafe for Proxy
impl Send for Proxy
impl Sync for Proxy
impl Unpin for Proxy
impl UnsafeUnpin for Proxy
impl UnwindSafe for Proxy
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
Mutably borrows from an owned value. Read more
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> 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
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
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<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> ⓘ
Converts
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> ⓘ
Converts
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 more