Skip to main content

Context

Trait Context 

Source
pub trait Context:
    Send
    + Sync
    + 'static { }
Expand description

Context is any user-defined type that is Send + Sync + 'static.

There is NO framework-level Context struct — users define their own. Middleware transforms one context type into another at compile time:

struct AppCtx { db: DbPool, headers: HeaderMap }
struct AuthCtx { db: DbPool, user: User }
// auth middleware: AppCtx → AuthCtx

Implementors§

Source§

impl<T: Send + Sync + 'static> Context for T