Skip to main content

Crate purwa_core

Crate purwa_core 

Source
Expand description

Purwa core — HTTP kernel built on Axum (see workspace purwa facade).

Applications can take full control of routing by using the AxumRouter type and Tower services directly (escape hatch; PRD §3.1).

Re-exports§

pub use config::AppConfig;
pub use config::AppSection;
pub use config::DatabaseSection;
pub use config::InertiaSection;
pub use config::PurwaConfigError;
pub use config::ServerSection;
pub use error::PurwaError;
pub use error::ValidationErrorBody;
pub use error::flatten_validation_errors;
pub use extract::ValidatedForm;
pub use extract::ValidatedJson;
pub use logging::init_tracing;
pub use logging::init_tracing_with_filter;
pub use routing::RegisteredRoute;
pub use routing::RouteDescriptor;
pub use routing::format_route_table;
pub use routing::route_descriptors;
pub use routing::router_from_inventory;

Modules§

config
Typed configuration from purwa.toml, merged with environment variables.
error
Application errors (Sprint 5 validation; Sprint 10 central enum + HTTP mapping).
extract
Validating Axum extractors (JSON and URL-encoded form).
logging
Tracing subscriber bootstrap (Sprint 10).
routing
Route registration via inventory and Axum Router.

Structs§

AppState
Shared application state (PRD §5.3). Holds Arc resources only — no globals.

Functions§

app_router
Default application router: Sprint 1 hello on / plus any routes registered via Purwa macros (router_from_inventory).

Type Aliases§

AxumRouter
Type alias for the default Axum router with unit state — use this when composing custom routes.
PgPool
An alias for Pool, specialized for Postgres.