pub struct ProxyTarget {
pub host: String,
pub port: u16,
pub is_tls: bool,
pub auth_header: Option<String>,
}Expand description
Parsed components of a forward proxy URL.
Fields§
§host: StringHost name of the proxy (used for both DNS and TLS SNI when
ProxyTarget::is_tls is true).
port: u16TCP port of the proxy.
is_tls: booltrue when the proxy URL scheme is https.
auth_header: Option<String>Pre-computed Proxy-Authorization header value, if the URL embeds
user:pass@.
Implementations§
Source§impl ProxyTarget
impl ProxyTarget
Sourcepub fn parse(url: &str) -> Result<Self, TransportError>
pub fn parse(url: &str) -> Result<Self, TransportError>
Parse a proxy URL into the components needed to establish the tunnel.
Only http:// and https:// schemes are accepted here. Use
ProxyKind::parse when callers need to distinguish recognised but
unsupported schemes (currently SOCKS) from malformed input.
§Errors
Returns TransportError::InvalidUrl for malformed URLs, missing
hosts, or any scheme other than http/https.
Trait Implementations§
Source§impl Clone for ProxyTarget
impl Clone for ProxyTarget
Source§fn clone(&self) -> ProxyTarget
fn clone(&self) -> ProxyTarget
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProxyTarget
impl Debug for ProxyTarget
Source§impl PartialEq for ProxyTarget
impl PartialEq for ProxyTarget
impl Eq for ProxyTarget
impl StructuralPartialEq for ProxyTarget
Auto Trait Implementations§
impl Freeze for ProxyTarget
impl RefUnwindSafe for ProxyTarget
impl Send for ProxyTarget
impl Sync for ProxyTarget
impl Unpin for ProxyTarget
impl UnsafeUnpin for ProxyTarget
impl UnwindSafe for ProxyTarget
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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