xecute
xecute is a small dependency-injection runtime and macro facade for Axum applications.
It provides typed providers, application/request scopes, module metadata, and
startup validation. It is intentionally independent of any larger framework.
use ;
;
let container = builder..build?;
let clock = container.?;
# Ok::
It re-exports #[injectable], #[module], and the routing macros, so applications
need only this one dependency.
Controller methods and validated payloads
Import xecute::prelude::*. Annotate a controller struct with
#[controller("/v1/auth")] and #[derive(Injectable)], then put #[routes] on
its implementation. HTTP handlers can take &self, #[body] request: Dto, and
#[query] request: Dto. DTOs derive serde::Deserialize, garde::Validate,
and schemars::JsonSchema. The generated adapters decode and validate before
calling the handler. Invalid values return 422; submitted values are omitted
from public validation errors. JSON syntax/content-type errors retain their
HTTP status.
#[api(summary = "...", tag = "...", operation_id = "...")],
#[body(json = RequestDto)], and #[resp(200, "Description", json = ReplyDto)]
populate Controller::api_operations(). Pass these operations to
xecute::openapi_document to build OpenAPI 3.1 with DTO/response schemas.
Generated CLI applications register this document with their default Swagger UI.