Struct Request

pub struct Request { /* private fields */ }

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) -> &Method

Get the method.

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

Get a mutable reference to the method.

fn url(&self) -> &Url

Get the url.

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

Get a mutable reference to the url.

fn headers(&self) -> &HeaderMap

Get the headers.

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

Get a mutable reference to the headers.

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

Get the body.

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

Get a mutable reference to the body.

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

Get the timeout.

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

Get a mutable reference to the timeout.

fn version(&self) -> Version

Get the http version.

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

Get a mutable reference to the http version.

fn try_clone(&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.

Trait Implementations

impl Debug for Request

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

impl<T> TryFrom<Request<T>> for Request where T: Into<Body>,

type Error = Error;
fn try_from(req: HttpRequest<T>) -> Result<Self>

Auto Trait Implementations

impl !Freeze for Request

impl !RefUnwindSafe for Request

impl !UnwindSafe for Request

impl Send for Request

impl Sync for Request

impl Unpin for Request

impl UnsafeUnpin for Request

Blanket Implementations

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

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

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

impl<T> From<T> for Request

impl<T> Instrument for Request

impl<T> PolicyExt for Request where T: ?Sized,

impl<T> WithSubscriber for Request

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

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

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