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

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