StateExtractable<T extends Object> class final

Reads application state attached with Router.withState.

@State() NoteRepo repo lowers to this. It is the counterpart to axum's State<S>: the parameter's type selects the value, so nothing has to name a key on both sides.

Missing state is a 500. The handler cannot run, and the fault is a composition mistake rather than anything the client did.

Implemented types

Constructors

StateExtractable()
Reads the state of type T.
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

extract(Request request) → Future<Result<T, Rejection>>
Produces the value, or the rejection that stops the handler.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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