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) -> SelfConstructs a new request.
fn method(&self) -> &MethodGet the method.
fn method_mut(&mut self) -> &mut MethodGet a mutable reference to the method.
fn url(&self) -> &UrlGet the url.
fn url_mut(&mut self) -> &mut UrlGet a mutable reference to the url.
fn headers(&self) -> &HeaderMapGet the headers.
fn headers_mut(&mut self) -> &mut HeaderMapGet 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) -> VersionGet the http version.
fn version_mut(&mut self) -> &mut VersionGet a mutable reference to the http version.
fn try_clone(&self) -> Option<Request>Attempt to clone the request.
Noneis 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,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for Request
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Request
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> From<T> for Request
fn from(t: T) -> TReturns the argument unchanged.
impl<T> Instrument for Request
impl<T> PolicyExt for Request
where
T: ?Sized,
fn and<P, B, E>(self, other: P) -> And<T, P> where T: Sized + Policy<B, E>, P: Policy<B, E>,fn or<P, B, E>(self, other: P) -> Or<T, P> where T: Sized + Policy<B, E>, P: Policy<B, E>,
impl<T> WithSubscriber for Request
impl<T, U> Into<U> for Request
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for Request
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for Request
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>