Struct Request

struct Request { ... }

A request which can be executed with Client::execute().

Implementations

impl Request

fn new(method: Method, url: Url) -> Self

Constructs a new request.

fn method(self: &Self) -> &Method

Get the method.

fn method_mut(self: &mut Self) -> &mut Method

Get a mutable reference to the method.

fn url(self: &Self) -> &Url

Get the url.

fn url_mut(self: &mut Self) -> &mut Url

Get a mutable reference to the url.

fn headers(self: &Self) -> &HeaderMap

Get the headers.

fn headers_mut(self: &mut Self) -> &mut HeaderMap

Get a mutable reference to the headers.

fn body(self: &Self) -> Option<&Body>

Get the body.

fn body_mut(self: &mut Self) -> &mut Option<Body>

Get a mutable reference to the body.

fn timeout(self: &Self) -> Option<&Duration>

Get the timeout.

fn timeout_mut(self: &mut Self) -> &mut Option<Duration>

Get a mutable reference to the timeout.

fn version(self: &Self) -> Version

Get the http version.

fn version_mut(self: &mut Self) -> &mut Version

Get a mutable reference to the http version.

fn try_clone(self: &Self) -> Option<Request>

Attempt to clone the request.

None is returned if the request can not be cloned, i.e. if the body is a stream.

impl Debug for Request

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

impl Freeze for Request

impl RefUnwindSafe for Request

impl Send for Request

impl Sync for Request

impl Unpin for Request

impl UnsafeUnpin for Request

impl UnwindSafe for Request

impl<T> Any for Request

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for Request

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for Request

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

impl<T> ErasedDestructor for Request

impl<T> From for Request

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Instrument for Request

impl<T> PolicyExt for Request

fn and<P, B, E>(self: Self, other: P) -> And<T, P>
where
    T: Policy<B, E>,
    P: Policy<B, E>
fn or<P, B, E>(self: Self, other: P) -> Or<T, P>
where
    T: Policy<B, E>,
    P: Policy<B, E>

impl<T> TryFrom for Request

fn try_from(req: HttpRequest<T>) -> Result<Self>

impl<T> WithSubscriber for Request

impl<T, U> Into for Request

fn into(self: Self) -> U

Calls U::from(self).

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

impl<T, U> TryFrom for Request

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

impl<T, U> TryInto for Request

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