Struct rustful::context::Context [] [src]

pub struct Context<'a, 'b: 'a, 'l, 'g> {
    pub headers: Headers,
    pub http_version: HttpVersion,
    pub address: SocketAddr,
    pub method: Method,
    pub uri_path: UriPath,
    pub hyperlinks: Vec<Link<'l>>,
    pub variables: Parameters,
    pub query: Parameters,
    pub fragment: Option<MaybeUtf8Owned>,
    pub global: &'g Global,
    pub body: BodyReader<'a, 'b>,
}

A container for handler input, like request data and utilities.

Fields

Headers from the HTTP request.

The HTTP version used in the request.

The client address

The HTTP method.

The requested path.

Hyperlinks from the current endpoint.

Route variables.

Query variables from the path.

The fragment part of the URL (after #), if provided.

Globally accessible data.

A reader for the request body.

Methods

impl<'a, 'b, 'l, 'g> Context<'a, 'b, 'l, 'g>
[src]

Create a context with minimal setup, for testing purposes.

Replace the hyperlinks. This consumes the context and returns a new one with a different lifetime, together with the old hyperlinks.

Trait Implementations

Auto Trait Implementations

impl<'a, 'b, 'l, 'g> Send for Context<'a, 'b, 'l, 'g>

impl<'a, 'b, 'l, 'g> !Sync for Context<'a, 'b, 'l, 'g>