Struct thruster::builtins::basic_context::BasicContext[][src]

pub struct BasicContext {
    pub body: String,
    pub params: HashMap<String, String>,
    pub query_params: HashMap<String, String>,
    pub request: Request,
    pub status: u32,
    pub headers: HashMap<String, String>,
}

Fields

Methods

impl BasicContext
[src]

Set a header on the response

Remove a header on the response

Set the response status code

Set the response Content-Type. A shortcode for

This example is not tested
ctx.set("Content-Type", "some-val");

Set up a redirect, will default to 302, but can be changed after the fact.

This example is not tested
ctx.set("Location", "/some-path");
ctx.status(302);

Sets a cookie on the response

Trait Implementations

impl Context for BasicContext
[src]

impl HasQueryParams for BasicContext
[src]

Auto Trait Implementations