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_jsontypes 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
chronotypes.
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_activateimplementation so you don’t need to writeBox::pin(async move { ... })by hand. - intercept_
fn - Wraps the body of an
Interceptor::interceptimplementation so you don’t need to writeBox::pin(async move { ... })by hand.
Structs§
- Application
- A compiled and initialized application ready to listen.
- Application
Builder - Starts application construction from a root module and platform adapter.
- Axum
Adapter - Builds an Axum router from a compiled Ironic HTTP application.
- Axum
Application - A built Axum application that can be tested, extended, or served.
- Build
Info - Build-time metadata about the running binary.
- Cache
Metadata - Cache configuration attached to a route definition.
- Compiled
Application Graph - A complete validated application graph.
- Compiled
Http Application - Immutable runtime state consumed by an HTTP platform adapter.
- Compiled
Module - A validated application module with precomputed provider visibility.
- Compiled
Route - A normalized executable route in a compiled HTTP application.
- Compiled
Test Module - A validated module graph and its isolated dependency container.
- Config
Watcher - A handle that receives updated configuration values when watched files change.
- Configuration
Loader - Builds a typed configuration from layered files, JSON, and environment variables.
- Container
- An immutable dependency injection container.
- Container
Builder - Builds an immutable dependency injection container.
- Controller
Definition - Static metadata, provider construction, and routes for a controller.
- Dependency
- A dependency declared by a provider factory.
- Feature
Gate Guard - Guard that gates routes behind a runtime feature toggle.
- Feature
Toggle - Runtime feature toggles backed by configuration values.
- Filter
Context - Request context available to exception filters.
- Form
Body - Deserializes an
application/x-www-form-urlencodedrequest body intoT. - Handler
Arguments - Extracted, type-erased arguments supplied to a controller handler adapter.
- Header
Map - HTTP headers used by transport-neutral requests and responses. A specialized multimap for header names and values.
- Header
Name - HTTP headers used by transport-neutral requests and responses. Represents an HTTP header field name
- Header
Parameter - Extracts and parses one named request header.
- Header
Value - HTTP headers used by transport-neutral requests and responses. Represents an HTTP header field value.
- Health
Config - Configuration for the composite health endpoint.
- Health
Module - Imports the composite
GET /healthreadiness endpoint, plusGET /health/live(liveness probe) andGET /health/ready(readiness probe). - Http
Error - A safe, structured HTTP request or handler failure.
- Http
Method - The HTTP method used in route metadata. The Request Method (VERB)
- Http
Status - The HTTP status code used by framework responses.
An HTTP status code (
status-codein RFC 9110 et al.). - Interceptor
Next - A consuming handle that invokes the next interceptor exactly once.
- Json
- Marks a value for JSON response serialization.
- Json
Body - Deserializes the request body from JSON into
T. - Lifecycle
Definition - Type-erased lifecycle callbacks registered for one provider.
- Lifecycle
Definition Builder - Builds explicit lifecycle metadata for provider
T. - Lifecycle
Error - A safe lifecycle callback failure.
- Middleware
Next - A consuming handle that invokes the next middleware exactly once.
- Missing
Platform - Marker used until an application builder receives a platform adapter.
- Module
Configuration Error - A safe error returned by asynchronous module configuration.
- Module
Definition - The complete static declaration of one module.
- Module
Definition Builder - Builds a static module definition.
- Module
Definition Factory - A lazily expanded static module import.
- Module
Id - The stable, type-based identity of a static module.
- Module
Ref - Runtime access to the dependency injection container for lazy resolution and dynamic provider access.
- Open
ApiAxum Adapter - Axum adapter wrapper that serves an
OpenAPIdocument and optional Swagger UI. - Open
ApiAxum Application - Built Axum application with
OpenAPIendpoints installed. - Open
ApiConfig - Configuration for a generated
OpenAPI3.1 document. - Open
ApiDocument - A generated, serializable
OpenAPIdocument. - Open
ApiOperation OpenAPImetadata attached to a compiled route.- Open
ApiParameter - Documentation for one operation parameter.
- Open
ApiRequest Body - Documentation for a JSON request body.
- Open
ApiResponse - Documentation for one response status.
- Pagination
- Parsed pagination parameters from
?page=N&size=M. - Parse
Bool Pipe - Parses a string parameter into a
bool. - Parse
Float Pipe - Parses a string parameter into an
f64. - Parse
IntPipe - Parses a string parameter into an
i64. - Path
Parameter - Extracts and parses one named path parameter.
- Pipeline
Components - Immutable pipeline component registrations at one scope.
- Provider
Definition - A complete provider registration description.
- Provider
Health - Per-provider health statistics.
- Provider
Health Summary - Consolidated health summary for the container.
- Provider
Key - A stable, type-based provider identifier.
- Query
Parameters - 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.
- Request
Context - Mutable request state passed through extraction and handler dispatch.
- Request
Id - A request correlation identifier available through
RequestContext::extension. - Request
Logging - Logs HTTP request/response pairs as structured tracing events.
- Request
Scope - An isolated dependency resolver for one request.
- Request
Tracing - 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.
- Route
Definition - An executable route owned by a controller definition.
- Route
Metadata - 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.
- Test
Application - A complete application that dispatches requests without binding a network port.
- Test
Application Builder - Builds an in-process HTTP application with test-local provider overrides.
- Test
Module - Entry point for compiling a module with test-local provider overrides.
- Test
Module Builder - Builds an isolated module container.
- Test
Request Builder - A fluent in-process HTTP request builder.
- Test
Response - An in-process response with typed accessors and focused assertions.
- Uri
- The parsed request URI. The URI component of a request.
- Version
Metadata - Version metadata attached to a controller definition.
- WsGateway
Definition - An executable WebSocket gateway registered with a compiled HTTP application.
Enums§
- AppError
- A top-level framework failure.
- Application
Error - Application build, serving, or lifecycle failure.
- Axum
Platform Error - A failure while converting framework metadata into Axum routes.
- Body
- An owned transport-neutral response body.
- CliError
- A command-line operation failure.
- Configuration
Error - A typed configuration loading or validation failure.
- Guard
Decision - The result of an authorization guard.
- Health
Status - The result of a single health check.
- Http
Application Build Error - A failure while turning a validated module graph into HTTP runtime state.
- Module
Error - A module graph validation failure.
- Open
ApiAxum Error OpenAPIgeneration or delegated Axum platform failure.- Open
ApiError - An
OpenAPIdocument generation failure. - Parameter
Location - The location of a documented operation parameter.
- Registration
Error - An error encountered while building a container.
- Resolve
Error - A provider resolution failure.
- Route
Error - A route or controller definition failure.
- Scope
- The lifetime policy of a provider registration.
- Security
Scheme - A reusable
OpenAPIauthentication scheme. - Shutdown
Signal - The reason application serving stopped.
- Test
Build Error - A failure while compiling an isolated test module.
- Value
- Represents any valid JSON value.
- Versioning
Strategy - 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§
- After
Shutdown - Runs after ALL
OnModuleDestroycallbacks have completed. - Async
Module Init - Runs after the DI container is built but before any lifecycle hooks fire.
- Before
Shutdown - Runs immediately after a shutdown signal is received, BEFORE the server stops accepting new connections.
- Erased
Handler - Invokes a controller method through type-erased runtime metadata.
- Exception
Ext - Extension trait for
Result<T, HttpError>providing inline exception handling. - Exception
Filter - Catches an
HttpErrorand produces a framework response. - Guard
- Determines whether a request may invoke its handler.
- Health
Indicator - A component that can report its health status.
- Http
Platform Adapter - Builds a native HTTP application from transport-neutral runtime state.
- Http
Platform Application - Serves a built native HTTP application.
- Interceptor
- Wraps extraction and handler execution.
- Into
Response - Converts a handler result into a framework response.
- Middleware
- Wraps request execution before guards and handlers.
- Module
- A statically declared Ironic application module.
- OnApplication
Bootstrap - Runs after every module initialization callback has succeeded.
- OnApplication
Shutdown - Runs after serving stops and before module destruction.
- OnError
- Called on every unhandled error before exception filters run.
- OnGuard
Denied - Called when any
GuardreturnsGuardDecision::Deny. - OnModule
Configure - Runs during module graph compilation, before any providers are built.
- OnModule
Destroy - Runs during cleanup in reverse successful-initialization order.
- OnModule
Init - Runs after a provider’s module and dependencies are available.
- OnModule
Load - Runs when a module is dynamically loaded after bootstrap.
- OnModule
Unload - Runs when a module is dynamically unloaded at runtime.
- OnRequest
Destroy - Runs when the request scope ends and the provider is about to be dropped.
- OnRequest
Init - Runs when a request-scoped provider is first resolved within a request.
- OnServer
Ready - Runs after the HTTP server binds to a port and is ready to accept connections.
- Open
ApiAxum Ext - Adds
OpenAPIgeneration to the standard Axum adapter. - Open
ApiRoute Ext - Adds
OpenAPI-specific metadata without coupling the HTTP kernel toOpenAPI. - Open
ApiSchema - Produces an
OpenAPI-compatible JSON Schema for a Rust type. - Parameter
Extractor - Extracts one typed handler parameter from a request context.
- Parameter
Pipe - Transforms or validates one extracted handler parameter.
- Validate
Configuration - 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.
- Extract
Future - The asynchronous result of parameter extraction.
- Extracted
Value - A type-erased extracted handler argument.
- Guard
Future - The asynchronous result of guard evaluation.
- Handler
Future - The asynchronous result of erased handler invocation.
- Lifecycle
Future - The asynchronous result of a lifecycle callback.
- Pipe
Future - The asynchronous result of parameter transformation or validation.
- Pipeline
Future - The asynchronous result of middleware or interceptor execution.
- Platform
Future - The asynchronous result of platform serving.
- Provider
Value - A type-erased provider value used by framework internals.
- Secret
String - 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
tokioor 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 appliesOption<T>values fromselfonto a target of the same type. - Module
- Derives a static application module definition.
- Open
ApiSchema - Derives an
OpenAPIschema for a named-field struct. - Serializable
- Derives a
field_rules()method from#[exclude]and#[expose(role = "...")]field attributes.