Expand description
Procedural macros for siderite.
These macros are re-exported by the siderite facade crate; generated code
only refers to ::siderite::... paths, so depend on siderite, not on this
crate directly.
#[get("/path", ...)],#[post(..)],#[put(..)],#[patch(..)],#[delete(..)],#[head(..)],#[options(..)],#[ws(..)]: attach a route (and its OpenAPI metadata) to anasync fnhandler.routes![a, module::b]: collect the routes generated by those attributes.#[derive(Schema)]: JSON Schema / OpenAPI schema generation compatible with the commonserdeattributes, plus the matchingDump.#[derive(Validate)]: request validation (coercion, constraints, aliases, string transforms) generated from the same attributes.#[derive(Model)]: ORM model metadata, typed field handles, theModelimplementation and relation accessors.#[model_hooks]: field/model validators, computed fields and serializers on an inherentimplblock.
Macros§
- routes
- Collect the routes of handlers annotated with the route attributes.
Attribute Macros§
- delete
- Route
DELETErequests to the annotatedasync fn. Seeget. - get
- Route
GETrequests to the annotatedasync fn. - head
- Route
HEADrequests to the annotatedasync fn. Seeget. - model_
hooks - Turn an inherent
implblock into aModelHooksimplementation. - options
- Route
OPTIONSrequests to the annotatedasync fn. Seeget. - patch
- Route
PATCHrequests to the annotatedasync fn. Seeget. - post
- Route
POSTrequests to the annotatedasync fn. Seeget. - put
- Route
PUTrequests to the annotatedasync fn. Seeget. - receiver
- Turn an
async fninto an ORM signal receiver:#[receiver(post_save, model = User)]. - ws
- Route a WebSocket upgrade (a
GETrequest) to the annotatedasync fn. Seeget.
Derive Macros§
- Model
- Derive
siderite::orm::Model: static column metadata, one typedField<Self, T>constant per field (User::name),to_values/from_row, and the relation accessors. - Schema
- Derive
siderite::validation::Schema(JSON Schema / OpenAPI 3.1) and the matchingsiderite::validation::Dump. - Validate
- Derive
siderite::validation::Validate.