Struct hyper_proxy::ProxyConnector
source · [−]pub struct ProxyConnector<C> { /* private fields */ }
Expand description
A wrapper around Proxy
s with a connector.
Implementations
sourceimpl<C> ProxyConnector<C>
impl<C> ProxyConnector<C>
sourcepub fn from_proxy(connector: C, proxy: Proxy) -> Result<Self, Error>
pub fn from_proxy(connector: C, proxy: Proxy) -> Result<Self, Error>
Create a proxy connector and attach a particular proxy
sourcepub fn from_proxy_unsecured(connector: C, proxy: Proxy) -> Self
pub fn from_proxy_unsecured(connector: C, proxy: Proxy) -> Self
Create a proxy connector and attach a particular proxy
sourcepub fn with_connector<CC>(self, connector: CC) -> ProxyConnector<CC>
pub fn with_connector<CC>(self, connector: CC) -> ProxyConnector<CC>
Change proxy connector
sourcepub fn set_tls(&mut self, tls: Option<NativeTlsConnector>)
pub fn set_tls(&mut self, tls: Option<NativeTlsConnector>)
Set or unset tls when tunneling
sourcepub fn extend_proxies<I: IntoIterator<Item = Proxy>>(&mut self, proxies: I)
pub fn extend_proxies<I: IntoIterator<Item = Proxy>>(&mut self, proxies: I)
Extend the list of proxies
sourcepub fn http_headers(&self, uri: &Uri) -> Option<&HeaderMap>
pub fn http_headers(&self, uri: &Uri) -> Option<&HeaderMap>
Get http headers for a matching uri
These headers must be appended to the hyper Request for the proxy to work properly. This is needed only for http requests.
Trait Implementations
sourceimpl<C: Clone> Clone for ProxyConnector<C>
impl<C: Clone> Clone for ProxyConnector<C>
sourcefn clone(&self) -> ProxyConnector<C>
fn clone(&self) -> ProxyConnector<C>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<C: Debug> Debug for ProxyConnector<C>
impl<C: Debug> Debug for ProxyConnector<C>
sourceimpl<C> Service<Uri> for ProxyConnector<C> where
C: Service<Uri>,
C::Response: AsyncRead + AsyncWrite + Send + Unpin + 'static,
C::Future: Send + 'static,
C::Error: Into<Box<dyn Error + Send + Sync>>,
impl<C> Service<Uri> for ProxyConnector<C> where
C: Service<Uri>,
C::Response: AsyncRead + AsyncWrite + Send + Unpin + 'static,
C::Future: Send + 'static,
C::Error: Into<Box<dyn Error + Send + Sync>>,
type Response = ProxyStream<C::Response>
type Response = ProxyStream<C::Response>
Responses given by the service.
type Future = Pin<Box<dyn Future<Output = Result<Self::Response, Self::Error>> + Send>>
type Future = Pin<Box<dyn Future<Output = Result<Self::Response, Self::Error>> + Send>>
The future response value.
Auto Trait Implementations
impl<C> !RefUnwindSafe for ProxyConnector<C>
impl<C> Send for ProxyConnector<C> where
C: Send,
impl<C> Sync for ProxyConnector<C> where
C: Sync,
impl<C> Unpin for ProxyConnector<C> where
C: Unpin,
impl<C> !UnwindSafe for ProxyConnector<C>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more