Firefly for Rust
Rust’s type system. A shared way to build.
Firefly for Rust brings application patterns into the Tokio and Axum ecosystem. Compose typed handlers, dependency injection, reactive operations, and persistence while keeping Rust’s explicit contracts.
- Rust 1.88+
- Tokio
- Axum
The building blocks,
explained.
Explore what this implementation provides, with a direct path to the code behind each capability.
- Reactive composition
Compose asynchronous values with Mono operators for mapping, chaining, recovery, retries and timeouts.
Explore this capability- Dependency injection
Register components and resolve dependencies with singleton and transient lifecycles.
Explore this capability- Typed CQRS dispatch
Route typed commands and queries through registered handlers and a middleware chain.
Explore this capability- Compensating sagas
Attach compensating actions to steps and unwind completed work when a later step fails.
Explore this capability- SQLx repositories
Use repository APIs for SQL reads, writes, filtering and pagination, with explicit not-found and optimistic-lock results.
Explore this capability
From the source
See the ideas
in real code.
Verbatim Lumen Ledger entry point: link the actual layer crates, include controllers, and run FireflyApplication on Tokio.
View the complete sourcefirefly::link!(
lumen_ledger_core,
lumen_ledger_models,
lumen_ledger_interfaces
);
mod controllers;
#[tokio::main]
async fn main() -> Result<(), firefly::BoxError> {
firefly::FireflyApplication::new("lumen-ledger")
.version(firefly::VERSION)
.run()
.await
}
Learn through Lumen Ledger.
See how a real sample connects its application, domain, and infrastructure. Read the source alongside its guide and tests.
Follow the Lumen quickstart
Read the book’s real first-service walkthrough and its application bootstrap.
Follow this stepInspect the Lumen Ledger entry point
See how the sample links its layer crates and starts FireflyApplication.
Follow this stepTrace a failed saga
Read the source test that fails the shipping step and verifies reverse-order compensation.
Follow this step
Learn by building
Firefly for Rust by Example
Event-Driven Rust Microservices with the Firefly Framework
Build Lumen Ledger while exploring application composition, event-driven services, persistence, and clear service boundaries. English and Spanish editions are available.
PDF & EPUB · v26.6.36
Keep exploring.
Follow the projects and references connected to Firefly for Rust.
