Struct chttp::options::Options [] [src]

pub struct Options {
    pub redirect_policy: RedirectPolicy,
    pub preferred_http_version: Option<Version>,
    pub timeout: Option<Duration>,
    pub connect_timeout: Duration,
    pub tcp_keepalive: Option<Duration>,
    pub tcp_nodelay: bool,
    pub auto_referer: bool,
    pub proxy: Option<Uri>,
}

Defines various protocol and connection options.

Fields

The policy for automatically following server redirects.

The default is to not follow redirects.

A preferred HTTP version the client should attempt to use to communicate to the server with.

This is treated as a suggestion. A different version may be used if the server does not support it or negotiates a different version.

The default value is None (any version).

A timeout for the maximum time allowed for a request-response cycle.

The default value is None (unlimited).

A timeout for the initial connection phase.

The default value is 300 seconds.

Enable or disable TCP keepalive with a given probe interval.

The default value is None (disabled).

Enable or disable the TCP_NODELAY option.

The default value is false.

Indicates whether the Referer header should be automatically updated.

A proxy to use for requests.

The proxy protocol is specified by the URI scheme.

  • http: Proxy. Default when no scheme is specified.
  • https: HTTPS Proxy. (Added in 7.52.0 for OpenSSL, GnuTLS and NSS)
  • socks4: SOCKS4 Proxy.
  • socks4a: SOCKS4a Proxy. Proxy resolves URL hostname.
  • socks5: SOCKS5 Proxy.
  • socks5h: SOCKS5 Proxy. Proxy resolves URL hostname.

Methods

impl Options
[src]

[src]

Trait Implementations

impl Clone for Options
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Options
[src]

[src]

Formats the value using the given formatter.

impl Default for Options
[src]

[src]

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