RequestContext class final

Mutable request-scoped state shared by middleware and handlers.

Constructors

RequestContext({required ServerRequest request, required AppContext app, ServerInvocation? invocation})
Creates a request context backed by an application context.

Properties

app → AppContext
Explicitly installed application modules for this request.
final
hashCode → int
The hash code for this object.
no setterinherited
invocation → ServerInvocation
Adapter-owned state for this request.
no setter
request → ServerRequest
The incoming request.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

contains<T>(RequestKey<T> key) → bool
Whether a request-local value exists for key.
get<T>(RequestKey<T> key) → T?
Reads a request-local value.
maybe<T extends Object>(ContextKey<T> key) → T?
Reads an optional application service.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
read<T extends Object>(ContextKey<T> key) → T
Reads an application service.
require<T>(RequestKey<T> key) → T
Reads a required request-local value.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited