Expand description
Anvil core — HTTP layer, container, configuration, and cross-cutting concerns.
Re-exports§
pub use app::Application;pub use container::Container;pub use container::ContainerBuilder;pub use container::FromContainer;pub use error::Error;pub use error::Result;pub use middleware::MiddlewareRegistry;pub use middleware::NamedMiddleware;pub use response::Redirect;pub use response::Responder;pub use response::ViewResponse;pub use route::Router;pub use route::Route;pub use ::async_trait;pub use ::futures;pub use ::inventory;pub use ::serde;pub use ::serde_json;pub use ::tokio;pub use ::tracing;pub use ::axum;pub use ::chrono;pub use ::uuid;pub use ::cast_core;pub use ::forge;
Modules§
- app
- Application builder. Mirrors Laravel 11’s
bootstrap/app.rs. - auth
- Auth: sessions, guards, policies. Argon2-backed.
- cache
- Cache subsystem. Trait-object based, with Moka (in-memory) and Redis drivers.
- config
- Configuration loading.
.envvia dotenvy + typed config structs inconfig/*.rs. - container
- The service container. Two layers:
- error
- Unified error type for Anvil. Implements
IntoResponseso handlers?-propagate freely. - event
- Event bus. Typed pub/sub with sync and queued listeners.
- Mail. SMTP via lettre, with an in-memory fake driver for tests.
- middleware
- Named middleware registry. Strings like
"auth","throttle:60,1","csrf"are resolved at app-init time to towerLayers. - notification
- Notifications. A notifiable can receive a notification via one or more channels.
- queue
- Queue subsystem. Jobs dispatched as serialized payloads; workers deserialize and run.
- request
- Request extras — re-exports and helpers around Axum extractors.
- response
- Response builders. View rendering, redirects, JSON helpers.
- route
- Routing DSL — a thin Laravel-shaped layer over Axum’s
Router. - schedule
- Scheduler. Cron-style expressions matched per tick from
smith schedule:run. - session
- Session subsystem. Thin wrapper around tower-sessions.
- shutdown
- Graceful shutdown signal handling for
smith serveand queue workers. - storage
- Storage subsystem. Thin wrapper over object_store for local/S3/GCS.
- tracing_
init - Tracing initialization. JSON output in prod, pretty in dev.
- validation
- Form request + validation. Wraps garde.
- view
- View rendering helpers. Wraps Forge templates as HTTP responses.
Macros§
- view
view!macro shortcut for handlers: returns aResult<ViewResponse, Error>.