Struct reset_router::Request
[−]
[src]
pub struct Request<'a> { /* fields omitted */ }Hyper Request and the matching regex
Methods
impl<'a> Request<'a>[src]
fn captures(&self) -> Option<Captures>
Captures (if any) from the matched path regex
fn extract_captures<T: CaptureExtraction>(&self) -> Result<T, Error>
Parsed capture segments
Use like:
let (id, slug): (i32, String) = req.extract_captures().unwrap();
fn into_inner(self) -> HyperRequest
Methods from Deref<Target = HyperRequest>
fn uri(&self) -> &Uri
Read the Request Uri.
fn version(&self) -> HttpVersion
Read the Request Version.
fn headers(&self) -> &Headers
Read the Request headers.
fn method(&self) -> &Method
Read the Request method.
fn body_ref(&self) -> Option<&B>
Read the Request body.
fn remote_addr(&self) -> Option<SocketAddr>
The remote socket address of this request
This is an Option, because some underlying transports may not have
a socket address, such as Unix Sockets.
This field is not used for outgoing requests.
fn path(&self) -> &str
The target path of this Request.
fn query(&self) -> Option<&str>
The query string of this Request.
fn set_method(&mut self, method: Method)
Set the Method of this request.
fn headers_mut(&mut self) -> &mut Headers
Get a mutable reference to the Request headers.
fn set_uri(&mut self, uri: Uri)
Set the Uri of this request.
fn set_version(&mut self, version: HttpVersion)
Set the HttpVersion of this request.
fn set_body<T>(&mut self, body: T) where
T: Into<B>,
T: Into<B>,
Set the body of the request.
By default, the body will be sent using Transfer-Encoding: chunked. To
override this behavior, manually set a [ContentLength] header with the
length of body.
fn set_proxy(&mut self, is_proxy: bool)
Set that the URI should use the absolute form.
This is only needed when talking to HTTP/1 proxies to URLs not protected by TLS.
fn deconstruct(self) -> (Method, Uri, HttpVersion, Headers, Body)
Deconstruct this Request into its pieces.
Modifying these pieces will have no effect on how hyper behaves.
fn body(self) -> Body
Take the Request body.
Trait Implementations
impl<'a> RequestExtensions for Request<'a>[src]
impl<'a> Deref for Request<'a>[src]
type Target = HyperRequest
The resulting type after dereferencing
fn deref(&self) -> &Self::Target
The method called to dereference a value
impl<'a> DerefMut for Request<'a>[src]
impl<'a> From<HyperRequest> for Request<'a>[src]
fn from(t: HyperRequest) -> Self
Performs the conversion.