[−][src]Struct thruster::BasicHyperContext
Fields
body: Body
query_params: HashMap<String, String, RandomState>
request: HyperRequest
status: u16
headers: HashMap<String, String, RandomState>
Methods
impl BasicHyperContext
[src]
pub fn new() -> BasicHyperContext
[src]
pub fn param(&mut self, key: &str) -> Option<&String>
[src]
Get a a parameter
pub fn set(&mut self, key: &str, value: &str)
[src]
Set a header on the response
pub fn remove(&mut self, key: &str)
[src]
Remove a header on the response
pub fn status(&mut self, code: u16)
[src]
Set the response status code
pub fn content_type(&mut self, c_type: &str)
[src]
Set the response Content-Type
. A shortcode for
ⓘThis example is not tested
ctx.set("Content-Type", "some-val");
pub fn redirect(&mut self, destination: &str)
[src]
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);
pub fn cookie(&mut self, name: &str, value: &str, options: &CookieOptions)
[src]
Sets a cookie on the response
Trait Implementations
impl Context for BasicHyperContext
[src]
type Response = Response<Body>
fn get_response(self) -> <BasicHyperContext as Context>::Response
[src]
fn set_body(&mut self, body: Vec<u8>)
[src]
impl HasQueryParams for BasicHyperContext
[src]
fn set_query_params(
&mut self,
query_params: HashMap<String, String, RandomState>
)
[src]
&mut self,
query_params: HashMap<String, String, RandomState>
)
fn route(&self) -> &str
[src]
impl Default for BasicHyperContext
[src]
fn default() -> BasicHyperContext
[src]
Auto Trait Implementations
impl Send for BasicHyperContext
impl !Sync for BasicHyperContext
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.