[][src]Enum reqwest::header::RetryAfter

pub enum RetryAfter {
    Delay(Duration),
    DateTime(HttpDate),
}

The Retry-After header.

The Retry-After response-header field can be used with a 503 (Service Unavailable) response to indicate how long the service is expected to be unavailable to the requesting client. This field MAY also be used with any 3xx (Redirection) response to indicate the minimum time the user-agent is asked wait before issuing the redirected request. The value of this field can be either an HTTP-date or an integer number of seconds (in decimal) after the time of the response.

Examples

use std::time::Duration;
use hyper::header::{Headers, RetryAfter};

let mut headers = Headers::new();
headers.set(
    RetryAfter::Delay(Duration::from_secs(300))
);
use std::time::{SystemTime, Duration};
use hyper::header::{Headers, RetryAfter};

let mut headers = Headers::new();
let date = SystemTime::now() + Duration::from_secs(300);
headers.set(
    RetryAfter::DateTime(date.into())
);

Retry-After header, defined in RFC7231

Variants

Retry after this duration has elapsed

This can be coupled with a response time header to produce a DateTime.

Retry after the given DateTime

Trait Implementations

impl Clone for RetryAfter
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for RetryAfter
[src]

Formats the value using the given formatter. Read more

impl Copy for RetryAfter
[src]

impl Display for RetryAfter
[src]

Formats the value using the given formatter. Read more

impl Eq for RetryAfter
[src]

impl PartialEq<RetryAfter> for RetryAfter
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Header for RetryAfter
[src]

Returns the name of the header field this belongs to. Read more

Parse a header from a raw stream of bytes. Read more

Format a header to outgoing stream. Read more

Auto Trait Implementations

impl Send for RetryAfter

impl Sync for RetryAfter

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

impl<T> From for T
[src]

Performs the conversion.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

Converts the given value to a String. Read more

impl<T, U> Into for T where
    U: From<T>, 
[src]

Performs the conversion.

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Borrow for T where
    T: ?Sized
[src]

Important traits for &'a mut W

Immutably borrows from an owned value. Read more

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> BorrowMut for T where
    T: ?Sized
[src]

Important traits for &'a mut W

Mutably borrows from an owned value. Read more

impl<T> Any for T where
    T: 'static + ?Sized
[src]

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more