Expand description
Configuration options for HTTP client transport behavior.
This crate provides types for configuring various aspects of HTTP connections, including connection keep-alive behavior, connection pooling, and HTTP version support.
§Example
use std::time::Duration;
use fetch_options::{ConnectionLifetime, RequestFilter, TransportOptions};
fn configure(mut options: TransportOptions) -> TransportOptions {
options.connect_timeout = Duration::from_secs(10);
options.request_filter = RequestFilter::Https;
options.connection_pool = options
.connection_pool
.max_connections(64)
.connection_idle_timeout(Duration::from_secs(90))
.connection_lifetime(ConnectionLifetime::fixed(Duration::from_secs(300)));
options
}
let options = configure(TransportOptions::default());Structs§
- Connection
Info - Diagnostic information about the connection that served an HTTP response.
- Connection
Lifetime - Backs
ConnectionPoolOptions::connection_lifetime. - Connection
Pool Options - Configuration options for HTTP connection pooling.
- Http2
Options - Configuration options for HTTP/2 connections.
- Pool
Index - Selects a specific connection pool for a request by index.
- Pool
Selection - Configures how requests are distributed across multiple connection pools.
- Transport
Options - Public, transport-relevant subset of an HTTP client’s configuration.
Enums§
- Connection
Idle Timeout - Backs
ConnectionPoolOptions::connection_idle_timeout. - Connection
Keep Alive - Controls how HTTP connections are kept alive between requests.
- Request
Filter - Controls which URI schemes the HTTP client is willing to send to.