[go: up one dir, main page]

RequestExt

Trait RequestExt 

Source
pub trait RequestExt {
Show 15 methods // Required methods fn http_version(&self) -> Version; fn method(&self) -> &Method; fn scheme(&self) -> Scheme; fn host(&self) -> Host<'_>; fn virtual_root(&self) -> Option<&str>; fn path(&self) -> &str; fn path_mut(&mut self) -> &mut String; fn query_string(&self) -> Option<&str>; fn remote_addr(&self) -> SocketAddr; fn content_length(&self) -> Option<u64>; fn headers(&self) -> &HeaderMap; fn body(&mut self) -> &mut dyn Read; fn extensions(&self) -> &Extensions; fn mut_extensions(&mut self) -> &mut Extensions; // Provided method fn elapsed(&self) -> Duration { ... }
}

Required Methods§

Source

fn http_version(&self) -> Version

The version of HTTP being used

Source

fn method(&self) -> &Method

The request method, such as GET, POST, PUT, DELETE or PATCH

Source

fn scheme(&self) -> Scheme

The scheme part of the request URL

Source

fn host(&self) -> Host<'_>

The host part of the requested URL

Source

fn virtual_root(&self) -> Option<&str>

The initial part of the request URL’s path that corresponds to a virtual root. This allows an application to have a virtual location that consumes part of the path.

Source

fn path(&self) -> &str

The remainder of the path.

Source

fn path_mut(&mut self) -> &mut String

Obtain the request path for mutation/rewrite

Source

fn query_string(&self) -> Option<&str>

The portion of the request URL that follows the “?”

Source

fn remote_addr(&self) -> SocketAddr

The remote IP address of the client or the last proxy that sent the request.

Source

fn content_length(&self) -> Option<u64>

The byte-size of the body, if any

Source

fn headers(&self) -> &HeaderMap

The request’s headers, as conduit::Headers.

Source

fn body(&mut self) -> &mut dyn Read

A Reader for the body of the request

§Blocking

The returned value implements the blocking Read API and should only be read from while in a blocking context.

Source

fn extensions(&self) -> &Extensions

A readable map of extensions

Source

fn mut_extensions(&mut self) -> &mut Extensions

A mutable map of extensions

Provided Methods§

Source

fn elapsed(&self) -> Duration

The elapsed time since the start of the request (headers received)

§Panics

This method may panic if the server does not add StartInstant to the request extensions, or if it has been removed by the application.

Implementors§