Struct tsukuyomi::input::Input

source ·
pub struct Input<'task> {
    pub request: &'task Request<()>,
    pub params: &'task Option<Params<'task>>,
    pub states: &'task States<'task>,
    pub cookies: &'task mut Cookies<'task>,
    pub locals: &'task mut LocalMap,
    /* private fields */
}
Expand description

A proxy object for accessing the contextual information about incoming HTTP request and global/request-local state.

Fields

request: &'task Request<()>

The information of incoming request without the message body.

params: &'task Option<Params<'task>>

A set of extracted parameters from router.

states: &'task States<'task>

A proxy object for accessing shared states.

cookies: &'task mut Cookies<'task>

A proxy object for accessing Cookie values.

locals: &'task mut LocalMap

A typemap that holds arbitrary request-local data.

Implementations

Takes a raw instance of incoming message body from the context.

Registers the upgrade handler to the context.

Returns ‘true’ if the context has already upgraded.

Parses the header field Content-type and stores it into the localmap.

Stores this reference to the task local storage and executes the specified closure.

The stored reference to Input can be accessed by using input::with_get_current.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.