pub struct TransportOptions {
pub total_timeout: Option<Duration>,
pub max_redirects: Option<usize>,
pub http_version: Option<Version>,
pub omit_body: bool,
}Expand description
Per-request transport behavior carried through http::Request::extensions.
All request entrypoints consume these options, including WebSocket ones. The
built-in native wreq transport enforces redirect/version policy on the
WebSocket handshake; a WebSocket total_timeout remains in force for the
socket’s sends and receives. A native WebSocket handshake never sends the
request body, independently of omit_body.
The built-in Fetch transport enforces total_timeout, omit_body, and
max_redirects = Some(0). For its terminal WebSocket round trip, the timeout
covers both Fetch and socket use, while omit_body suppresses the initial
application frame. Fetch cannot select an HTTP version or guarantee an exact
positive redirect bound, so it returns ClientError::Config when either
unsupported constraint is set; callers may leave those fields as None to
use the host Fetch policy.
Fields§
§total_timeout: Option<Duration>§max_redirects: Option<usize>§http_version: Option<Version>§omit_body: boolTrait Implementations§
Source§impl Clone for TransportOptions
impl Clone for TransportOptions
Source§fn clone(&self) -> TransportOptions
fn clone(&self) -> TransportOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more