Struct hyper_proxy::ProxyConnector
[−]
[src]
pub struct ProxyConnector<C> { /* fields omitted */ }
A wrapper around Proxy
s with a connector.
Methods
impl<C> ProxyConnector<C>
[src]
pub fn new(connector: C) -> Result<Self, Error>
[src]
Create a new secured Proxies
pub fn unsecured(connector: C) -> Self
[src]
Create a new unsecured Proxy
pub fn from_proxy(connector: C, proxy: Proxy) -> Result<Self, Error>
[src]
Create a proxy connector and attach a particular proxy
pub fn from_proxy_unsecured(connector: C, proxy: Proxy) -> Self
[src]
Create a proxy connector and attach a particular proxy
pub fn with_connector<CC>(self, connector: CC) -> ProxyConnector<CC>
[src]
Change proxy connector
pub fn set_tls(&mut self, tls: Option<TlsConnector>)
[src]
Set or unset tls when tunneling
pub fn proxies(&self) -> &[Proxy]
[src]
Get the current proxies
pub fn add_proxy(&mut self, proxy: Proxy)
[src]
Add a new additional proxy
pub fn extend_proxies<I: IntoIterator<Item = Proxy>>(&mut self, proxies: I)
[src]
Extend the list of proxies
pub fn http_headers(&self, uri: &Uri) -> Option<&Headers>
[src]
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
impl<C: Clone> Clone for ProxyConnector<C>
[src]
fn clone(&self) -> ProxyConnector<C>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<C: Debug> Debug for ProxyConnector<C>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
Formats the value using the given formatter. Read more
impl<C> Service for ProxyConnector<C> where
C: Service<Request = Uri, Error = Error> + 'static,
C::Future: 'static,
<C::Future as Future>::Item: AsyncRead + AsyncWrite + 'static,
[src]
C: Service<Request = Uri, Error = Error> + 'static,
C::Future: 'static,
<C::Future as Future>::Item: AsyncRead + AsyncWrite + 'static,
type Request = Uri
Requests handled by the service.
type Response = ProxyStream<C::Response>
Responses given by the service.
type Error = Error
Errors produced by the service.
type Future = Box<Future<Item = ProxyStream<C::Response>, Error = Self::Error>>
The future response value.
fn call(&self, uri: Uri) -> Self::Future
[src]
Process the request and return the response asynchronously.
Auto Trait Implementations
impl<C> Send for ProxyConnector<C> where
C: Send,
C: Send,