[−][src]Struct thruster_context::basic_hyper_context::BasicHyperContext
Fields
body: Bodyquery_params: HashMap<String, String>request: HyperRequeststatus: u16headers: HashMap<String, String>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 Default for BasicHyperContext[src]
fn default() -> BasicHyperContext[src]
impl Context for BasicHyperContext[src]
type Response = Response<Body>
fn get_response(self) -> Self::Response[src]
fn set_body(&mut self, body: Vec<u8>)[src]
impl HasQueryParams for BasicHyperContext[src]
Auto Trait Implementations
impl Send for BasicHyperContext
impl !Sync for BasicHyperContext
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> From<T> for T[src]
impl<T, U> TryFrom<U> 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, U> TryInto<U> 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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,