Skip to main content

RequestHead

Type Alias RequestHead 

Source
pub type RequestHead = Parts;
Expand description

HTTP request head type.

Aliased Type§

pub struct RequestHead {
    pub method: Method,
    pub uri: Uri,
    pub version: Version,
    pub headers: HeaderMap,
    pub extensions: Extensions,
    /* private fields */
}

Fields§

§method: Method

The request’s method

§uri: Uri

The request’s URI

§version: Version

The request’s version

§headers: HeaderMap

The request’s headers

§extensions: Extensions

The request’s extensions

Trait Implementations§

Source§

impl RequestExt for RequestHead

Source§

async fn extract_from_head<E>(&mut self) -> Result<E>
where E: FromRequestHead + 'static,

Runs an extractor implementing FromRequestHead on the request. Read more
Source§

fn context(&self) -> &ProjectContext

Get the application context. Read more
Source§

fn project_config(&self) -> &ProjectConfig

Get the project configuration. Read more
Source§

fn router(&self) -> &Arc<Router> ⓘ

Get the router. Read more
Source§

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

Returns the name of the app that the current route belongs to, or None if the request is not routed. Read more
Source§

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

Returns the name of the current route. Read more
Source§

fn path_params(&self) -> &PathParams

Get the path parameters. Read more
Source§

fn path_params_mut(&mut self) -> &mut PathParams

Get the path parameters mutably. Read more
Source§

fn content_type(&self) -> Option<&HeaderValue>

Get the content type of the request. Read more
Source§

fn expect_content_type(&mut self, expected: &'static str) -> Result<()>

Expect the content type of the request to be the given value. Read more