pub struct RequestStatePair<R, S> {
pub request: R,
pub ctx: Option<Context<S>>,
}Expand description
Simple implementation of a ContextSmuggler.
Fields§
§request: Rthe inner reuqest
ctx: Option<Context<S>>the storage to “smuggle” the ctx“
Implementations§
Source§impl<R, S> RequestStatePair<R, S>
impl<R, S> RequestStatePair<R, S>
Trait Implementations§
Source§impl<R, S> ContextSmuggler<S> for RequestStatePair<R, S>
impl<R, S> ContextSmuggler<S> for RequestStatePair<R, S>
Source§fn inject_ctx(&mut self, ctx: Context<S>)
fn inject_ctx(&mut self, ctx: Context<S>)
inject the context into the smuggler.
Source§fn try_extract_ctx(&mut self) -> Option<Context<S>>
fn try_extract_ctx(&mut self) -> Option<Context<S>>
try to extract the smuggled context out of the smuggle,
which is only possible once.
Source§impl<R, S> Deref for RequestStatePair<R, S>
impl<R, S> Deref for RequestStatePair<R, S>
Auto Trait Implementations§
impl<R, S> Freeze for RequestStatePair<R, S>
impl<R, S> !RefUnwindSafe for RequestStatePair<R, S>
impl<R, S> Send for RequestStatePair<R, S>
impl<R, S> Sync for RequestStatePair<R, S>
impl<R, S> Unpin for RequestStatePair<R, S>
impl<R, S> !UnwindSafe for RequestStatePair<R, S>
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