Struct isahc::config::ExpectContinue
source · [−]pub struct ExpectContinue { /* private fields */ }
Expand description
Controls the use of the Expect
request header when sending request bodies
with HTTP/1.1.
By default, when sending requests containing a body of large or unknown length over HTTP/1.1, Isahc will send the request headers first without the body and wait for the server to respond with a 100 (Continue) status code, as defined by RFC 7231, Section 5.1.1. This gives the opportunity for the server to reject the response without needing to first transmit the request body over the network, if the body contents are not necessary for the server to determine an appropriate response.
For servers that do not support this behavior and instead simply wait for the request body without responding with a 100 (Continue), there is a limited timeout before the response body is sent anyway without confirmation. The default timeout is 1 second, but this can be configured.
The Expect
behavior can also be disabled entirely.
This configuration only takes effect when using HTTP/1.1.
Implementations
sourceimpl ExpectContinue
impl ExpectContinue
sourcepub const fn enabled() -> Self
pub const fn enabled() -> Self
Enable the use of Expect
and wait for a 100 (Continue) response with a
default timeout before sending a request body.
Trait Implementations
sourceimpl Clone for ExpectContinue
impl Clone for ExpectContinue
sourcefn clone(&self) -> ExpectContinue
fn clone(&self) -> ExpectContinue
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ExpectContinue
impl Debug for ExpectContinue
sourceimpl Default for ExpectContinue
impl Default for ExpectContinue
sourceimpl From<Duration> for ExpectContinue
impl From<Duration> for ExpectContinue
Auto Trait Implementations
impl RefUnwindSafe for ExpectContinue
impl Send for ExpectContinue
impl Sync for ExpectContinue
impl Unpin for ExpectContinue
impl UnwindSafe for ExpectContinue
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more