pub struct TransportConfig {
pub connect_timeout: Option<Duration>,
pub read_timeout: Option<Duration>,
}Expand description
How the reqwest::Client a core’s default backend runs on bounds connecting and reading.
It is construction-only: ClientCore::with_config takes it by value and builds the client
from it, and ClientCore::new builds one from the default. A client injected with
ClientCore::with_client keeps its own timeouts instead, and a backend installed with
ClientCore::with_backend executes requests on its own terms. reqwest’s fetch backend has
neither timeout, so on wasm32 both are ignored.
The client built from it follows a redirect only within the origin of the request (the same
scheme, host and port), up to ten hops, and refuses one to another origin with
Error::Redirect, whose super::RedirectError::cross_origin_target names the target
without its userinfo and query; nothing is sent there. On wasm32 the browser’s fetch follows
redirects by its own policy instead.
Fields§
§connect_timeout: Option<Duration>How long establishing a connection may take — name resolution, the TCP handshake and TLS —
before the request fails with Error::Timeout (default 30 s; None waits as long as
the operating system does).
read_timeout: Option<Duration>How long a read on an established connection may wait for its next bytes — the response
head, or the next chunk of a body, a streamed one included — before the request fails with
Error::Timeout (default 5 min; None waits indefinitely). Each read that arrives
restarts it, so it bounds a stall, not the length of a response. An event stream whose
server sends nothing, not even a comment or heartbeat, for longer than this fails with
Error::Timeout, which a reconnect policy may answer by resuming it.
Trait Implementations§
Source§impl Clone for TransportConfig
impl Clone for TransportConfig
Source§fn clone(&self) -> TransportConfig
fn clone(&self) -> TransportConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TransportConfig
impl Debug for TransportConfig
Source§impl Default for TransportConfig
impl Default for TransportConfig
impl Eq for TransportConfig
Source§impl PartialEq for TransportConfig
impl PartialEq for TransportConfig
Source§fn eq(&self, other: &TransportConfig) -> bool
fn eq(&self, other: &TransportConfig) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for TransportConfig
Auto Trait Implementations§
impl Freeze for TransportConfig
impl RefUnwindSafe for TransportConfig
impl Send for TransportConfig
impl Sync for TransportConfig
impl Unpin for TransportConfig
impl UnsafeUnpin for TransportConfig
impl UnwindSafe for TransportConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
Arc<> Read more§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more