Expand description
§AllFrame
Complete Rust Web Framework with Built-in HTTP/2 Server
One frame to rule them all. Transform, compose, ignite.
AllFrame is a complete Rust web framework with a built-in HTTP/2 server, designed and evolved exclusively through Test-Driven Development (TDD).
§Quick Start
[dependencies]
allframe = "0.1"§What’s Included
- Built-in HTTP/2 Server - Powered by Hyper, no external server needed
- Multi-Protocol Support - REST, GraphQL, and gRPC from one codebase
- Compile-time DI - Dependency injection resolved at compile time
- Auto OpenAPI 3.1 - API documentation generated automatically
- CQRS + Event Sourcing - Production-ready infrastructure (85% less boilerplate)
- Beautiful API Docs - Scalar UI, GraphiQL, gRPC Explorer built-in
- Zero External Dependencies - Only Tokio, Hyper, and std
§Example
ⓘ
use allframe::prelude::*;
#[allframe::main]
async fn main() {
let app = App::new()
.route("/hello", get(hello_handler));
app.run().await;
}
#[api_handler]
async fn hello_handler() -> &'static str {
"Hello, AllFrame!"
}See the GitHub repository for more examples.
Modules§
- application
- Application layer orchestration and use case implementations. This module provides the orchestration layer that coordinates between domain logic and infrastructure, including resilience orchestration, transaction management, and business workflow coordination. Application layer orchestration and use case implementations.
- arch
- Clean Architecture enforcement with compile-time dependency injection.
- async_
trait - Re-export async_trait for async trait definitions github crates-io docs-rs
- cache
- Cache abstraction with in-memory and Redis backends.
- cqrs
- CQRS + Event Sourcing infrastructure with 85% boilerplate reduction.
- di
- Compile-time dependency injection infrastructure.
- domain
- Domain layer contracts and business logic primitives. This module provides the building blocks for Clean Architecture domain layers, including resilience contracts, business rules, and domain models. Domain layer contracts and business logic primitives.
- health
- Health check infrastructure for Kubernetes-ready services.
- hyper
- Re-export hyper for HTTP primitives
- otel
- OpenTelemetry automatic instrumentation for distributed tracing.
- prelude
- Prelude module for convenient imports
- router
- Protocol-agnostic request routing for REST, GraphQL, and gRPC.
- serde
- Re-export serde for serialization
- serde_
json - Re-export serde_json for JSON handling
- shutdown
- Graceful shutdown utilities for production services.
- tokio
- Re-export tokio for async runtime A runtime for writing reliable network applications without compromising speed.
- tracing
- Re-export tracing for observability A scoped, structured logging and diagnostics system.
Macros§
- erase_
handler - Erase a no-args handler into an
ErasedHandler. - erase_
handler_ with_ args - Erase a handler with typed args into an
ErasedHandler. - erase_
handler_ with_ state - Erase a handler with state + typed args into an
ErasedHandler. - erase_
handler_ with_ state_ only - Erase a state-only handler into an
ErasedHandler. - erase_
streaming_ handler - Erase a no-args streaming handler into an
ErasedStreamHandler. - erase_
streaming_ handler_ with_ args - Erase a streaming handler with typed args into an
ErasedStreamHandler. - erase_
streaming_ handler_ with_ state - Erase a streaming handler with state + typed args into an
ErasedStreamHandler. - erase_
streaming_ handler_ with_ state_ only - Erase a streaming handler with state only into an
ErasedStreamHandler. - register_
handlers - Bulk-register handler functions with a Router.
- register_
handlers_ erased - Register multiple handlers at once using the non-generic erased path.
Derive Macros§
- Health
Check - Re-export HealthCheck derive macro for automatic health check implementation Derive macro for automatic HealthCheck implementation