annotations library

Annotations: what Dust reads to generate handlers.

Import this in a file that only declares controllers or handler functions and leaves the wiring to generated code.

import 'package:dust_server/annotations.dart';

@Controller('/todos')
class TodoController with _$TodoController { ... }

Everything here is also exported from package:dust_server/server.dart.

Classes

Body
Binds a parameter to the typed request body.
Controller
Marks a class as an HTTP controller.
DELETE
Declares a DELETE route.
Extract
Binds a handler parameter to a custom extractor.
Field
Binds a parameter to one form field.
FormUrlEncoded
Declares that the handler's body is application/x-www-form-urlencoded.
GET
Declares a GET route.
Declares a HEAD route.
Binds a parameter to one header.
HeaderMap
Binds a parameter to the whole header map.
MultiPart
Declares that the handler's body is multipart/form-data.
OPTIONS
Declares an OPTIONS route.
Part
Binds a parameter to one multipart part.
PATCH
Declares a PATCH route.
Path
Binds a parameter to a router-captured path segment.
Peer
Binds a parameter to the connection's peer information.
POST
Declares a POST route.
PUT
Declares a PUT route.
Queries
Binds a parameter to the whole query map.
Query
Binds a parameter to one query value.
RawBody
Binds a parameter to the undecoded body.
RawQuery
Binds a parameter to the raw, undecoded query string.
Routes
Declares that a library's top-level handlers form a route module.
State
Binds a parameter to application state attached with withState.
Verb
The shared shape of every verb annotation.