[go: up one dir, main page]

ureq

Struct Timeouts

source
pub struct Timeouts {
    pub global: Option<Duration>,
    pub per_call: Option<Duration>,
    pub resolve: Option<Duration>,
    pub connect: Option<Duration>,
    pub send_request: Option<Duration>,
    pub await_100: Option<Duration>,
    pub send_body: Option<Duration>,
    pub recv_response: Option<Duration>,
    pub recv_body: Option<Duration>,
    /* private fields */
}
Expand description

Request timeout configuration.

This can be configured both on Agent level as well as per request.

Fields§

§global: Option<Duration>

Timeout for the entire call

This is end-to-end, from DNS lookup to finishing reading the response body. Thus it covers all other timeouts.

Defaults to None.

§per_call: Option<Duration>

Timeout for call-by-call when following redirects

This covers a single call and the timeout is reset when ureq follows a redirections.

Defaults to None.

§resolve: Option<Duration>

Max duration for doing the DNS lookup when establishing the connection

Because most platforms do not have an async syscall for looking up a host name, setting this might force str0m to spawn a thread to handle the timeout.

Defaults to None.

§connect: Option<Duration>

Max duration for establishing the connection

For a TLS connection this includes opening the socket and doing the TLS handshake.

Defaults to None.

§send_request: Option<Duration>

Max duration for sending the request, but not the request body.

Defaults to None.

§await_100: Option<Duration>

Max duration for awaiting a 100-continue response.

Only used if there is a request body and we sent the Expect: 100-continue header to indicate we want the server to respond with 100.

This defaults to 1 second.

§send_body: Option<Duration>

Max duration for sending a request body (if there is one)

Defaults to None.

§recv_response: Option<Duration>

Max duration for receiving the response headers, but not the body

Defaults to None.

§recv_body: Option<Duration>

Max duration for receving the response body.

Defaults to None.

Trait Implementations§

source§

impl Clone for Timeouts

source§

fn clone(&self) -> Timeouts

Returns a copy of the value. Read more
1.6.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Timeouts

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Timeouts

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Copy for Timeouts

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.