pub struct MiddlewareContext<TLayerCtx, TNewCtx = TLayerCtx, TState = ()>where
TState: Send,{
pub state: TState,
pub input: Value,
pub ctx: TNewCtx,
pub req: RequestContext,
pub phantom: PhantomData<TLayerCtx>,
}
Fields§
§state: TState
§input: Value
§ctx: TNewCtx
§req: RequestContext
§phantom: PhantomData<TLayerCtx>
Implementations§
Source§impl<TLayerCtx, TNewCtx> MiddlewareContext<TLayerCtx, TNewCtx, ()>where
TLayerCtx: Send,
impl<TLayerCtx, TNewCtx> MiddlewareContext<TLayerCtx, TNewCtx, ()>where
TLayerCtx: Send,
pub fn with_state<TState>(
self,
state: TState,
) -> MiddlewareContext<TLayerCtx, TNewCtx, TState>where
TState: Send,
Source§impl<TLayerCtx, TState> MiddlewareContext<TLayerCtx, TLayerCtx, TState>
impl<TLayerCtx, TState> MiddlewareContext<TLayerCtx, TLayerCtx, TState>
pub fn with_ctx<TNewCtx>( self, new_ctx: TNewCtx, ) -> MiddlewareContext<TLayerCtx, TNewCtx, TState>
Auto Trait Implementations§
impl<TLayerCtx, TNewCtx, TState> Freeze for MiddlewareContext<TLayerCtx, TNewCtx, TState>
impl<TLayerCtx, TNewCtx, TState> RefUnwindSafe for MiddlewareContext<TLayerCtx, TNewCtx, TState>
impl<TLayerCtx, TNewCtx, TState> Send for MiddlewareContext<TLayerCtx, TNewCtx, TState>
impl<TLayerCtx, TNewCtx, TState> Sync for MiddlewareContext<TLayerCtx, TNewCtx, TState>
impl<TLayerCtx, TNewCtx, TState> Unpin for MiddlewareContext<TLayerCtx, TNewCtx, TState>
impl<TLayerCtx, TNewCtx, TState> UnwindSafe for MiddlewareContext<TLayerCtx, TNewCtx, TState>
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