pub struct Context {
pub req: Request,
/* private fields */
}Expand description
Context holds request data and provides response building methods
Fields§
§req: RequestImplementations§
Source§impl Context
impl Context
Sourcepub async fn new(req: HyperRequest<Incoming>, params: Params) -> Result<Self>
pub async fn new(req: HyperRequest<Incoming>, params: Params) -> Result<Self>
Create a new context from a request and params
Sourcepub async fn set(&self, key: impl Into<String>, value: impl Into<String>)
pub async fn set(&self, key: impl Into<String>, value: impl Into<String>)
Set a value in the context state (shared between middleware)
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