pub struct Context<'a, T> {
pub state: T,
pub params: HashMap<String, String>,
/* private fields */
}
Fields
state: T
params: HashMap<String, String>
Implementations
sourceimpl<'a, T> Context<'a, T>
impl<'a, T> Context<'a, T>
pub fn new(
r: &'a Request,
params: HashMap<String, String>,
state: T,
fn_chains: Option<Vec<&'a HandlerFn<T>>>
) -> Self
pub fn next(&self)
pub fn abort(&self)
pub fn is_aborted(&self) -> bool
pub fn get_method(&self) -> &str
pub fn get_uri(&self) -> &str
pub fn get_header(&self, key: &str) -> Option<String>
pub fn host(&self) -> Option<String>
pub fn get_param(&self, key: &str) -> Option<String>
pub fn get_query(&self, key: &str) -> Option<String>
pub fn data_json<U: Serialize>(&self, code: u16, data: U)
pub fn header_set(&self, key: &str, value: &str)
pub fn data(&self, code: u16, data: Vec<u8>, mime: &str)
pub fn data_html(&self, code: u16, data: &str)
pub fn data_text(&self, code: u16, data: &str)
Auto Trait Implementations
impl<'a, T> !RefUnwindSafe for Context<'a, T>
impl<'a, T> Send for Context<'a, T>where
T: Send,
impl<'a, T> !Sync for Context<'a, T>
impl<'a, T> Unpin for Context<'a, T>where
T: Unpin,
impl<'a, T> !UnwindSafe for Context<'a, T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more