Skip to content

Decorators

This page is the index of every decorator the framework ships, grouped by concern. Skim the table for the one you need, click through to the page that explains it in context. Each row says where the decorator goes (struct, impl block, method, field) so you can confirm the position without leaving the page.

DecoratorGoes onSummaryRead more
#[module]structComposes a binary: lists providers it owns and imports it depends onModules
#[injectable]structMarks a provider built from the container, with optional scope = request | transientProviders
#[inject]fieldResolves the field from the container at constructionProviders
#[hooks]impl blockOrchestrates lifecycle methods on a providerLifecycle
#[on_module_init]methodRuns once after wiring, before servingLifecycle
#[on_application_bootstrap]methodRuns once after every module init, before servingLifecycle
#[on_module_destroy]methodRuns on shutdown after transports stopLifecycle
#[before_application_shutdown]methodRuns before the application begins shutting downLifecycle
#[on_application_shutdown]methodRuns last during shutdown, best-effortLifecycle
DecoratorGoes onSummaryRead more
#[controller]structMounts the struct as a controller with a base path and optional versionControllers
#[routes]impl blockWires methods to HTTP routes and emits the route tableControllers
#[get] #[post] #[put] #[patch] #[delete]methodBinds the method to an HTTP verb at the given pathControllers
#[http_code]methodOverrides the default response status codeResponses
#[response_header]methodAppends a response header (repeatable)Responses
#[redirect]methodIssues a redirect and discards the handler payloadResponses
#[use_guards]struct or methodBinds container-resolved Guards, first listed outermostGuards
#[use_interceptors]struct or methodBinds container-resolved InterceptorsInterceptors
#[use_filters]struct or methodBinds error-mapping Filters (response mapping; the global pool runs at the transport band)Exception filters
#[use_exception_filters]struct or methodBinds typed ExceptionFilters — downcast catch, the layer closest to the handlerException filters
#[meta]methodAttaches typed metadata read back via Reflector (repeatable)Guards
#[public]methodMarks the route public so auth guards skip itGuards
#[interceptor]structMarks a struct as a global HTTP interceptorInterceptors
#[input]structShorthand for input DTOs (Deserialize + Validate + deny_unknown_fields)Extractors
DecoratorGoes onSummaryRead more
#[resolver]struct + impl blockMarks a resolver provider and orchestrates its operationsGraphQL
#[query]methodRoot query operation; requires an access posture (#[authorize] or #[public])Queries and mutations
#[mutation]methodRoot mutation operation; requires an access posture (#[authorize] or #[public])Queries and mutations
#[authorize]methodAccess posture: gates the operation by ability (Action, Entity) and masks the responseQueries and mutations
#[public]methodAccess posture: deliberately ungated operation — no gate, no maskQueries and mutations
#[field_resolver]methodCustom field resolver on a wire type; takes no posture attributeField resolvers
#[dataloader]impl block on serviceBatches a method into a request-scoped DataLoaderDataloader
DecoratorGoes onSummaryRead more
#[gateway]structMounts a WebSocket gateway at a path on the HTTP transportWebSockets
#[messages]impl blockBinds gateway message handlers and lifecycle hooksMessages
#[subscribe_message]methodHandles one event in the { event, data } envelopeMessages
#[on_connect]methodRuns after the socket upgradesMessages
#[on_disconnect]methodRuns after the socket closesMessages
DecoratorGoes onSummaryRead more
#[processor]impl blockOrchestrates queue consumers on a providerQueue
#[process]methodBinds the method to a queue with optional concurrency and retriesQueue
DecoratorGoes onSummaryRead more
#[scheduled]impl blockOrchestrates scheduled methods on a providerSchedule
#[every]methodFires the method on a fixed intervalSchedule
#[cron]methodFires the method on a cron expression, optional tzSchedule
#[after]methodFires the method once, after a delay from bootSchedule
DecoratorGoes onSummaryRead more
#[listeners]impl blockOrchestrates event listeners on a providerEvents
#[on_event]methodSubscribes the method to its second-parameter event typeEvents
DecoratorGoes onSummaryRead more
#[mcp]structMounts an MCP handler over HTTP at a pathMCP
#[tool_router]impl blockRe-exported from rmcp: collects #[tool] methods into a routerMCP
#[tool_handler]impl blockRe-exported from rmcp: implements ServerHandler from the routerMCP
#[tool]methodRe-exported from rmcp: exposes the method as an MCP toolMCP
DecoratorGoes onSummaryRead more
#[indicators]impl blockOrchestrates health checks on a providerIndicators
#[liveness]methodBinds the method to the liveness probeIndicators
#[readiness]methodBinds the method to the readiness probeIndicators
#[startup]methodBinds the method to the startup probeIndicators
DecoratorGoes onSummaryRead more
#[config]structMarks a struct as a namespaced configuration loaded from env and filesConfiguration
DecoratorGoes onSummaryRead more
#[expose]struct + fieldExposes a SeaORM entity to GraphQL and OpenAPI from one declarationDatabase
#[crud]impl blockGenerates standard CRUD operations on a controller or resolverCRUD
DecoratorGoes onSummaryRead more
#[api]methodEnriches the OpenAPI operation with summary, description, and tagsOpenAPI