Skip to main content

Crate ironic

Crate ironic 

Source
Expand description

Ironic is a batteries-included, type-safe application framework for Rust.

Modules§

cli
Command-line argument definitions.
error_codes
Standard error codes and response patterns. Standard error codes and response patterns for the Ironic framework.
generators
Deterministic project and source generators.
integrations
Optional integrations with database drivers and object-relational mappers.
json
Convenience re-exports of serde_json types and macros.
logging
Structured logging for Ironic applications.
prelude
Commonly used Ironic types and macros.
presets
Pre-built configuration structs for common infrastructure components.
time
Convenience re-exports of chrono types.

Macros§

create_param_decorator
Creates a custom parameter decorator that can be used with #[decorator(DecoratorName)] in route handler signatures.
guard_fn
Wraps the body of a Guard::can_activate implementation so you don’t need to write Box::pin(async move { ... }) by hand.
intercept_fn
Wraps the body of an Interceptor::intercept implementation so you don’t need to write Box::pin(async move { ... }) by hand.

Structs§

Application
A compiled and initialized application ready to listen.
ApplicationBuilder
Starts application construction from a root module and platform adapter.
AxumAdapter
Builds an Axum router from a compiled Ironic HTTP application.
AxumApplication
A built Axum application that can be tested, extended, or served.
BuildInfo
Build-time metadata about the running binary.
CacheMetadata
Cache configuration attached to a route definition.
CompiledApplicationGraph
A complete validated application graph.
CompiledHttpApplication
Immutable runtime state consumed by an HTTP platform adapter.
CompiledModule
A validated application module with precomputed provider visibility.
CompiledRoute
A normalized executable route in a compiled HTTP application.
CompiledTestModule
A validated module graph and its isolated dependency container.
ConfigWatcher
A handle that receives updated configuration values when watched files change.
ConfigurationLoader
Builds a typed configuration from layered files, JSON, and environment variables.
Container
An immutable dependency injection container.
ContainerBuilder
Builds an immutable dependency injection container.
ControllerDefinition
Static metadata, provider construction, and routes for a controller.
Dependency
A dependency declared by a provider factory.
FeatureGateGuard
Guard that gates routes behind a runtime feature toggle.
FeatureToggle
Runtime feature toggles backed by configuration values.
FilterContext
Request context available to exception filters.
FormBody
Deserializes an application/x-www-form-urlencoded request body into T.
HandlerArguments
Extracted, type-erased arguments supplied to a controller handler adapter.
HeaderMap
HTTP headers used by transport-neutral requests and responses. A specialized multimap for header names and values.
HeaderName
HTTP headers used by transport-neutral requests and responses. Represents an HTTP header field name
HeaderParameter
Extracts and parses one named request header.
HeaderValue
HTTP headers used by transport-neutral requests and responses. Represents an HTTP header field value.
HealthConfig
Configuration for the composite health endpoint.
HealthModule
Imports the composite GET /health readiness endpoint, plus GET /health/live (liveness probe) and GET /health/ready (readiness probe).
HttpError
A safe, structured HTTP request or handler failure.
HttpMethod
The HTTP method used in route metadata. The Request Method (VERB)
HttpStatus
The HTTP status code used by framework responses. An HTTP status code (status-code in RFC 9110 et al.).
InterceptorNext
A consuming handle that invokes the next interceptor exactly once.
Json
Marks a value for JSON response serialization.
JsonBody
Deserializes the request body from JSON into T.
LifecycleDefinition
Type-erased lifecycle callbacks registered for one provider.
LifecycleDefinitionBuilder
Builds explicit lifecycle metadata for provider T.
LifecycleError
A safe lifecycle callback failure.
MiddlewareNext
A consuming handle that invokes the next middleware exactly once.
MissingPlatform
Marker used until an application builder receives a platform adapter.
ModuleConfigurationError
A safe error returned by asynchronous module configuration.
ModuleDefinition
The complete static declaration of one module.
ModuleDefinitionBuilder
Builds a static module definition.
ModuleDefinitionFactory
A lazily expanded static module import.
ModuleId
The stable, type-based identity of a static module.
ModuleRef
Runtime access to the dependency injection container for lazy resolution and dynamic provider access.
OpenApiAxumAdapter
Axum adapter wrapper that serves an OpenAPI document and optional Swagger UI.
OpenApiAxumApplication
Built Axum application with OpenAPI endpoints installed.
OpenApiConfig
Configuration for a generated OpenAPI 3.1 document.
OpenApiDocument
A generated, serializable OpenAPI document.
OpenApiOperation
OpenAPI metadata attached to a compiled route.
OpenApiParameter
Documentation for one operation parameter.
OpenApiRequestBody
Documentation for a JSON request body.
OpenApiResponse
Documentation for one response status.
Pagination
Parsed pagination parameters from ?page=N&size=M.
ParseBoolPipe
Parses a string parameter into a bool.
ParseFloatPipe
Parses a string parameter into an f64.
ParseIntPipe
Parses a string parameter into an i64.
PathParameter
Extracts and parses one named path parameter.
PipelineComponents
Immutable pipeline component registrations at one scope.
ProviderDefinition
A complete provider registration description.
ProviderHealth
Per-provider health statistics.
ProviderHealthSummary
Consolidated health summary for the container.
ProviderKey
A stable, type-based provider identifier.
QueryParameters
Deserializes the complete query string into T.
Reloadable
A hot-reloadable configuration value backed by a tokio::sync::watch.
Request
An owned, transport-neutral HTTP request.
RequestContext
Mutable request state passed through extraction and handler dispatch.
RequestId
A request correlation identifier available through RequestContext::extension.
RequestLogging
Logs HTTP request/response pairs as structured tracing events.
RequestScope
An isolated dependency resolver for one request.
RequestTracing
Adds request IDs, response correlation headers, and structured tracing spans.
Resolver
A restricted, clonable container view passed to provider factories.
Response
An owned transport-neutral HTTP response.
RouteDefinition
An executable route owned by a controller definition.
RouteMetadata
Cloneable, type-indexed metadata attached to a route definition.
Secret
A sensitive configuration value whose formatting and serialization are redacted.
Shutdown
An owned asynchronous shutdown trigger.
TestApplication
A complete application that dispatches requests without binding a network port.
TestApplicationBuilder
Builds an in-process HTTP application with test-local provider overrides.
TestModule
Entry point for compiling a module with test-local provider overrides.
TestModuleBuilder
Builds an isolated module container.
TestRequestBuilder
A fluent in-process HTTP request builder.
TestResponse
An in-process response with typed accessors and focused assertions.
Uri
The parsed request URI. The URI component of a request.
VersionMetadata
Version metadata attached to a controller definition.
WsGatewayDefinition
An executable WebSocket gateway registered with a compiled HTTP application.

Enums§

AppError
A top-level framework failure.
ApplicationError
Application build, serving, or lifecycle failure.
AxumPlatformError
A failure while converting framework metadata into Axum routes.
Body
An owned transport-neutral response body.
CliError
A command-line operation failure.
ConfigurationError
A typed configuration loading or validation failure.
GuardDecision
The result of an authorization guard.
HealthStatus
The result of a single health check.
HttpApplicationBuildError
A failure while turning a validated module graph into HTTP runtime state.
ModuleError
A module graph validation failure.
OpenApiAxumError
OpenAPI generation or delegated Axum platform failure.
OpenApiError
An OpenAPI document generation failure.
ParameterLocation
The location of a documented operation parameter.
RegistrationError
An error encountered while building a container.
ResolveError
A provider resolution failure.
RouteError
A route or controller definition failure.
Scope
The lifetime policy of a provider registration.
SecurityScheme
A reusable OpenAPI authentication scheme.
ShutdownSignal
The reason application serving stopped.
TestBuildError
A failure while compiling an isolated test module.
Value
Represents any valid JSON value.
VersioningStrategy
Strategy for API versioning.

Constants§

DEFAULT_DRAIN_TIMEOUT
Default graceful drain timeout during shutdown: 30 seconds.
DEFAULT_REQUEST_BODY_LIMIT
Default maximum buffered request body: 1 MiB.
DEFAULT_REQUEST_TIMEOUT
Default end-to-end request timeout: 30 seconds.

Traits§

AfterShutdown
Runs after ALL OnModuleDestroy callbacks have completed.
AsyncModuleInit
Runs after the DI container is built but before any lifecycle hooks fire.
BeforeShutdown
Runs immediately after a shutdown signal is received, BEFORE the server stops accepting new connections.
ErasedHandler
Invokes a controller method through type-erased runtime metadata.
ExceptionExt
Extension trait for Result<T, HttpError> providing inline exception handling.
ExceptionFilter
Catches an HttpError and produces a framework response.
Guard
Determines whether a request may invoke its handler.
HealthIndicator
A component that can report its health status.
HttpPlatformAdapter
Builds a native HTTP application from transport-neutral runtime state.
HttpPlatformApplication
Serves a built native HTTP application.
Interceptor
Wraps extraction and handler execution.
IntoResponse
Converts a handler result into a framework response.
Middleware
Wraps request execution before guards and handlers.
Module
A statically declared Ironic application module.
OnApplicationBootstrap
Runs after every module initialization callback has succeeded.
OnApplicationShutdown
Runs after serving stops and before module destruction.
OnError
Called on every unhandled error before exception filters run.
OnGuardDenied
Called when any Guard returns GuardDecision::Deny.
OnModuleConfigure
Runs during module graph compilation, before any providers are built.
OnModuleDestroy
Runs during cleanup in reverse successful-initialization order.
OnModuleInit
Runs after a provider’s module and dependencies are available.
OnModuleLoad
Runs when a module is dynamically loaded after bootstrap.
OnModuleUnload
Runs when a module is dynamically unloaded at runtime.
OnRequestDestroy
Runs when the request scope ends and the provider is about to be dropped.
OnRequestInit
Runs when a request-scoped provider is first resolved within a request.
OnServerReady
Runs after the HTTP server binds to a port and is ready to accept connections.
OpenApiAxumExt
Adds OpenAPI generation to the standard Axum adapter.
OpenApiRouteExt
Adds OpenAPI-specific metadata without coupling the HTTP kernel to OpenAPI.
OpenApiSchema
Produces an OpenAPI-compatible JSON Schema for a Rust type.
ParameterExtractor
Extracts one typed handler parameter from a request context.
ParameterPipe
Transforms or validates one extracted handler parameter.
ValidateConfiguration
Validates a fully deserialized application configuration.

Functions§

build_http_application
Builds the DI container and executable route table for a validated graph.
build_http_application_with_extra_providers
Builds HTTP runtime state, registering additional providers and applying overrides.
build_http_application_with_overrides
Builds HTTP runtime state and replaces selected provider registrations.
compile_controller_routes
Compiles routes from all controller definitions.
compile_module_graph
Compiles and validates a static module graph.
configure_health
Override the default health configuration.
handler_fn
Erases a typed asynchronous controller handler.
parse_bool
Creates a shared ParseBoolPipe.
parse_float
Creates a shared ParseFloatPipe.
parse_int
Creates a shared ParseIntPipe.
pipe_fn
Creates a synchronous typed transformation or validation pipe.
register_health_indicator
Register a health indicator (called by integration modules at startup).
run
Parses process arguments and executes the selected command.
run_with
Executes an already-parsed command and writes user-facing output to output.

Type Aliases§

AppResult
The result type used by framework operations.
ExtractFuture
The asynchronous result of parameter extraction.
ExtractedValue
A type-erased extracted handler argument.
GuardFuture
The asynchronous result of guard evaluation.
HandlerFuture
The asynchronous result of erased handler invocation.
LifecycleFuture
The asynchronous result of a lifecycle callback.
PipeFuture
The asynchronous result of parameter transformation or validation.
PipelineFuture
The asynchronous result of middleware or interceptor execution.
PlatformFuture
The asynchronous result of platform serving.
ProviderValue
A type-erased provider value used by framework internals.
SecretString
A secret UTF-8 string.

Attribute Macros§

api
Route metadata consumed by routes.
body
Route metadata consumed by routes.
cache
Route metadata consumed by routes.
controller
Declares a controller and its path prefix.
cron
Route metadata consumed by routes.
decorator
Route metadata consumed by routes.
delete
Route metadata consumed by routes.
form
Route metadata consumed by routes.
get
Route metadata consumed by routes.
guard
Route metadata consumed by routes.
head
Route metadata consumed by routes.
header
Route metadata consumed by routes.
interceptor
Route metadata consumed by routes.
interval
Route metadata consumed by routes.
main
Configures an async entry point with Ironic’s Tokio runtime.
middleware
Route metadata consumed by routes.
options
Route metadata consumed by routes.
param
Route metadata consumed by routes.
patch
Route metadata consumed by routes.
pipe
Route metadata consumed by routes.
post
Route metadata consumed by routes.
put
Route metadata consumed by routes.
query
Route metadata consumed by routes.
resp
Route metadata consumed by routes.
routes
Collects route metadata from an inherent controller implementation.
subscribe_message
Route metadata consumed by routes.
test
Wraps an async test function with Ironic’s Tokio runtime, removing the need for users to depend on tokio or use #[tokio::test].
timeout
Route metadata consumed by routes.
web_socket_gateway
Declares a WebSocket gateway and its path.

Derive Macros§

Injectable
Derives a dependency-injection provider definition.
Merge
Derives a merge_into(&mut self) method that applies Option<T> values from self onto a target of the same type.
Module
Derives a static application module definition.
OpenApiSchema
Derives an OpenAPI schema for a named-field struct.
Serializable
Derives a field_rules() method from #[exclude] and #[expose(role = "...")] field attributes.