[][src]Struct hyper::client::Config

pub struct Config<C, B> { /* fields omitted */ }

Configuration for a Client

Methods

impl<C, B> Config<C, B>
[src]

Set the body stream to be used by the Client.

Example

let cfg = Config::default()
    .body::<hyper::Body>();

Set the Connect type to be used.

Enable or disable keep-alive mechanics.

Default is enabled.

Set an optional timeout for idle sockets being kept-alive.

Pass None to disable timeout.

Default is 90 seconds.

Set whether HTTP/1 connections should try to use vectored writes, or always flatten into a single buffer.

Note that setting this to false may mean more copies of body data, but may also improve performance when an IO transport doesn't support vectored writes well, such as most TLS implementations.

Default is true.

Set whether to retry requests that get disrupted before ever starting to write.

This means a request that is queued, and gets given an idle, reused connection, and then encounters an error immediately as the idle connection was found to be unusable.

When this is set to false, the related FutureResponse would instead resolve to an Error::Cancel.

Default is true.

Set whether to automatically add the Host header to requests.

If true, and a request does not include a Host header, one will be added automatically, derived from the authority of the Uri.

Default is true.

impl<C, B> Config<C, B> where
    C: Connect,
    B: Stream<Error = Error>,
    B::Item: AsRef<[u8]>, 
[src]

Construct the Client with this configuration.

Construct a Client with this configuration and an executor.

The executor will be used to spawn "background" connection tasks to drive requests and responses.

impl<B> Config<UseDefaultConnector, B> where
    B: Stream<Error = Error>,
    B::Item: AsRef<[u8]>, 
[src]

Construct the Client with this configuration.

Trait Implementations

impl Default for Config<UseDefaultConnector, Body>
[src]

Returns the "default value" for a type. Read more

impl<C, B> Debug for Config<C, B>
[src]

Formats the value using the given formatter. Read more

impl<C: Clone, B> Clone for Config<C, B>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl<C, B> Send for Config<C, B> where
    B: Send,
    C: Send

impl<C, B> Sync for Config<C, B> where
    B: Sync,
    C: Sync

Blanket Implementations

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

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T> From for T
[src]

Performs the conversion.

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

Performs the conversion.

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

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

Important traits for &'a mut W

Immutably borrows from an owned value. Read more

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

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

Important traits for &'a mut W

Mutably borrows from an owned value. Read more

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

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more