endpoint!() { /* proc-macro */ }Expand description
Defines an endpoint type with builder-style options.
Desugars nested wrappers (Protected, Validated, Strict, etc.)
into a single readable declaration.
§Syntax
ⓘ
endpoint! {
GET "users" / u32 => Json<User>,
auth: AuthUser,
errors: JsonError,
strict: true,
}
endpoint! {
POST "users",
body: CreateUser => Json<User>,
auth: AuthUser,
validate: CreateUserValidator,
content_type: json,
errors: JsonError,
version: V1,
}§Fields
- Method + path +
=>response (required) body:request body type (for POST/PUT/PATCH)auth:wraps inProtected<Auth, _>validate:wraps inValidated<V, _>content_type:wraps inContentType<C, _>(jsonor a type)errors:sets theErrtype parameterversion:wraps inVersioned<V, _>strict:wraps inStrict<_>(iftrue)rate_limit:wraps inRateLimited<R, _>