Skip to main content

Crate xecute

Crate xecute 

Source
Expand description

A small, explicit dependency-injection runtime for Axum applications.

Container owns application providers while ModuleGraph verifies module boundaries before the application starts. The older Injector API is retained for applications migrating from the first preview release.

Re-exports§

pub use middleware::Application;
pub use versioning::ApiVersion;
pub use versioning::ApiVersions;
pub use versioning::VersionError;

Modules§

config
Typed configuration readers and redacted validation errors. Typed environment access with value-redacted validation errors.
exceptions
Safe HTTP error envelopes, normalization, and request correlation. Consistent error envelopes and explicit mappings from domain errors.
middleware
HTTP middleware and application pipeline composition. Ordered HTTP middleware for applications, controllers, and routes.
prelude
Common controller types and macros.
versioning
Explicit route version groups and per-version OpenAPI metadata. Explicit URL version groups with independently validated OpenAPI documents.

Structs§

ApiOperation
Route documentation collected by #[routes]; this is metadata, not an OpenAPI schema.
ApiResponse
Documentation attached to one declared controller response.
Container
Thread-safe provider container with shared singleton and isolated request caches.
ContainerBuilder
Builds a validated Container.
DocumentationError
Invalid or conflicting route documentation discovered before serving traffic.
HttpError
Safe HTTP failure with a JSON envelope; request boundaries add correlation IDs.
Inject
Extract a provider using the request’s shared dependency scope. Install with_container once on assembled routes, or use a generated scoped_router.
Injector
Compatibility injector storing cloneable application values.
ModuleDefinition
Declarative module metadata, used to validate imports and exports.
ModuleGraph
Validates module metadata and flattens modules into a container.
ProviderDefinition
A provider registration. Dependencies are metadata used for startup validation.
ProviderKey
A type-safe key used to identify a provider.
RequestScope
Owned request-local provider cache. Clones share only this request’s values. Returned Arcs can outlive the HTTP request if retained by application code.
ValidatedJson
JSON extractor used by generated #[body] adapters to validate DTOs automatically.
ValidatedQuery
Query extractor used by generated #[query] adapters to validate DTOs automatically.

Enums§

InjectError
Errors discovered while constructing or validating an application.
Scope
The lifecycle of a provider instance.

Traits§

Injectable
Compatibility construction contract for applications using the original injector.
Provider
Types generated by #[injectable] can register themselves with a container.

Functions§

json_schema
Generate a schema using the same Serde contract as the DTO or response entity.
openapi_document
Build an OpenAPI 3.1 document; reject duplicate paths, IDs, and schema names.
with_container
Create a fresh DI cache for each request before running controller middleware/extractors. Singleton caches are shared across requests; dropping a request releases its cached values.

Type Aliases§

HttpStatus
HTTP status codes usable by controllers without importing Axum internals.
RequestContainer
Compatibility name for the owned request scope; the lifetime no longer restricts ownership. Existing RequestContainer<'a> type annotations continue to compile.

Attribute Macros§

body
Preserve this annotation for the owning route or module macro.
controller
Generate a controller router from method route attributes.
delete
Declare an HTTP DELETE handler.
exception
Preserve this annotation for the owning route or module macro.
extension
Preserve this annotation for the owning route or module macro.
get
Declare an HTTP GET handler.
global
Marks a module as globally visible. It is consumed by #[module].
guard
Preserve this annotation for the owning route or module macro.
head
Declare an HTTP HEAD handler.
header
Preserve this annotation for the owning route or module macro.
injectable
Generate dependency-injection factories for a struct.
interceptor
Preserve this annotation for the owning route or module macro.
middleware
Declare ordered controller or route middleware under #[controller] or #[routes].
module
Declare module providers, imports, and exported dependencies.
on_bootstrap
Preserve this annotation for the owning route or module macro.
on_module_destroy
Preserve this annotation for the owning route or module macro.
on_module_init
Preserve this annotation for the owning route or module macro.
on_shutdown
Preserve this annotation for the owning route or module macro.
options
Declare an HTTP OPTIONS handler.
param
Preserve this annotation for the owning route or module macro.
patch
Declare an HTTP PATCH handler.
post
Declare an HTTP POST handler.
put
Declare an HTTP PUT handler.
query
Preserve this annotation for the owning route or module macro.
request
Preserve this annotation for the owning route or module macro.
routes
Generate an Axum router for an inherent controller implementation.
scope
Selects the provider lifecycle used by #[injectable] (singleton, transient, or request).
state
Preserve this annotation for the owning route or module macro.
test_module
Preserve this annotation for the owning route or module macro.
validate
Preserve this annotation for the owning route or module macro.

Derive Macros§

Injectable
Derive dependency-injection factories without changing the struct declaration.