Struct hyper_proxy::ProxyConnector[][src]

pub struct ProxyConnector<C> { /* fields omitted */ }

A wrapper around Proxys with a connector.

Implementations

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<NativeTlsConnector>)[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<&HeaderMap>[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]

impl<C: Debug> Debug for ProxyConnector<C>[src]

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>>, 
[src]

type Response = ProxyStream<C::Response>

Responses given by the service.

type Error = Error

Errors produced by the service.

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.