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 version(&self) -> VersionGet the http version.
fn version_mut(&mut self) -> &mut VersionGet a mutable reference to the http version.
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 try_clone(&self) -> Option<Request>Attempts to clone the
Request.None is returned if a body is which can not be cloned. This can be because 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>