[][src]Struct awc::ClientBuilder

pub struct ClientBuilder { /* fields omitted */ }

An HTTP Client builder

This type can be used to construct an instance of Client through a builder-like pattern.

Methods

impl ClientBuilder[src]

pub fn new() -> Self[src]

pub fn connector<T>(self, connector: T) -> Self where
    T: Service<Request = Uri, Error = ConnectError> + 'static,
    T::Response: Connection,
    <T::Response as Connection>::Future: 'static,
    T::Future: 'static, 
[src]

Use custom connector service.

pub fn disable_redirects(self) -> Self[src]

Do not follow redirects.

Redirects are allowed by default.

pub fn max_redirects(self, num: usize) -> Self[src]

Set max number of redirects.

Max redirects is set to 10 by default.

pub fn no_default_headers(self) -> Self[src]

Do not add default request headers. By default Date and User-Agent headers are set.

pub fn header<K, V>(self, key: K, value: V) -> Self where
    HeaderName: HttpTryFrom<K>,
    <HeaderName as HttpTryFrom<K>>::Error: Debug,
    V: IntoHeaderValue,
    V::Error: Debug
[src]

Add default header. Headers adds byt this method get added to every request.

pub fn finish(self) -> Client[src]

Finish build process and create Client instance.

Auto Trait Implementations

Blanket Implementations

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

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

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

The type returned in the event of a conversion error.

impl<T> Erased for T