pub struct Context {
pub params: Vec<Captures<'static, 'static>>,
/* private fields */
}Expand description
§The context of a request.
This is a wrapper around a crate::http::Request and a crate::http::Response that provides access to the request and response as well as some additional information such as the state and parameters.
Fields§
§params: Vec<Captures<'static, 'static>>Any error captured during the request. The parsed request parameters
Implementations§
Source§impl Context
impl Context
Sourcepub fn try_borrow<T: 'static>(&self) -> Option<&T>
pub fn try_borrow<T: 'static>(&self) -> Option<&T>
Try borrow a context value
Sourcepub fn borrow<T: 'static>(&self) -> &T
pub fn borrow<T: 'static>(&self) -> &T
Borrow a context value Panics if the value does not exist
Sourcepub fn try_borrow_mut<T: 'static>(&mut self) -> Option<&mut T>
pub fn try_borrow_mut<T: 'static>(&mut self) -> Option<&mut T>
Try borrow a mutable context value
Sourcepub fn borrow_mut<T: 'static>(&mut self) -> &mut T
pub fn borrow_mut<T: 'static>(&mut self) -> &mut T
Borrow a mutable context value Panics if the value does not exist
Sourcepub fn take<T: 'static>(&mut self) -> T
pub fn take<T: 'static>(&mut self) -> T
Take a context value Panics if the value does not exist
Sourcepub fn insert<T: Send + Sync + 'static>(&mut self, value: T) -> Option<T>
pub fn insert<T: Send + Sync + 'static>(&mut self, value: T) -> Option<T>
Insert a context value
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Context
impl !RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl !UnwindSafe for Context
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more