Struct shio::context::Context [] [src]

pub struct Context { /* fields omitted */ }

Context represents the context of the current HTTP request.

A Context consists of: - The current HTTP Request. - Shared and per-request State. - A Handle referencing the event loop in which this request is being handled.

Methods

impl Context
[src]

[src]

Return a reference to a handle to the event loop this Context is associated with.

[src]

Take the request body.

[src]

Puts a value into the request state.

[src]

Gets a value from the request state.

With the nightly feature enabled, this will fallback to checking the shared state.

Panics

If there is no value in the request state of the given type.

[src]

Gets a value from the request state.

[src]

Gets a reference to the shared state.

[src]

Deconstruct current context

Methods from Deref<Target = Request>

[src]

Returns a reference to the request HTTP version.

[src]

Returns a reference to the request headers.

[src]

Returns a reference to the request HTTP method.

[src]

Returns a reference to the request URI.

[src]

Returns a reference to the request path.

Trait Implementations

impl Deref for Context
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.