Crate map
The siderite crate is the public facade. Application code depends on it
and use siderite::prelude::*;. The other crates exist so HTTP, validation,
and the ORM do not form a cycle.
user application │ ▼ siderite (facade + prelude) │ ├── siderite-core App, routing, extractors, ApiError │ ├── siderite-validation │ └── siderite-orm ├── siderite-openapi ├── siderite-orm ├── siderite-config └── siderite-cache └── siderite-core
siderite-backends ──► siderite-ormsiderite-migrations ──► siderite-ormsiderite-macros ·generates code for· core, orm, validationsiderite-cli ──► migrations, configsiderite-testkit ──► core| Crate | Owns |
|---|---|
siderite |
Public facade, prelude |
siderite-core |
App, handler/extractor/response traits, DI, middleware, lifespan, WebSockets, forms, headers/cookies, background tasks, static files, RFC 7807 errors, security schemes |
siderite-validation |
Validate, structured ValidationError, rules, constrained newtypes, Schema + SchemaRegistry |
siderite-orm |
Model, QuerySet, relations, transactions, signals, database routing, QueryPlan IR, Expr, capabilities |
siderite-backends |
Dialect-aware SQL compiler and executors: SQLite, PostgreSQL, MySQL; MongoDB (supported QuerySet subset); Redis key/hash/set client |
siderite-macros |
Route attributes, routes![], #[derive(Model, Validate, Schema)], #[model_hooks], #[receiver] |
siderite-openapi |
Typed OpenAPI 3.1 model, document builder, Swagger UI / ReDoc |
siderite-migrations |
Migration graph, operations, autodetector, schema editor (PostgreSQL, SQLite, MySQL), executor |
siderite-config |
Layered configuration, Secret, init_tracing |
siderite-cache |
Cache trait, in-memory LRU, Redis cache, RouteCache middleware |
siderite-sessions |
Cookie sessions, CSRF tokens, MemoryStore and cache-backed CacheStore; depends on core, not re-exported by the facade |
siderite-cli |
AppCli and the standalone siderite binary |
siderite-testkit |
TestClient, TestDatabase |
siderite-bench |
Criterion benchmarks (not published) |
Dependency rules
Section titled “Dependency rules”- The ORM has no HTTP knowledge.
siderite-ormdoes not depend onsiderite-core. The core crate implementsFrom<OrmError> for ApiError. - Schema metadata lives in validation.
Schema/SchemaObjectsit insiderite-validationso that core (request bodies) and openapi (documents) share one definition without a cycle. - Backends depend on the ORM, never the reverse. The ORM defines the
Backendtrait and the capability model; each backend implements them. - HTTP traits are siderite’s own.
FromRequestParts,FromRequest,IntoResponse, andHandlercarrydescribehooks. - Axum and SQLx are internal. Public types are siderite newtypes
(
Json,Path,Query,State,MethodRouter, …).