rustio_core/lib.rs
1//! RustIO — a batteries-included web framework for Rust.
2//!
3//! Typical usage goes through the `rustio` CLI, which scaffolds projects
4//! that depend on this crate. See <https://github.com/abdulwahed-sweden/rustio>.
5//!
6//! The headline modules:
7//!
8//! - [`http`] — [`Request`], [`Response`], response builders, form/query parsing.
9//! - [`router`] — path matching (`:param`) and request dispatch.
10//! - [`middleware`] — around-style middleware with [`Next`].
11//! - [`context`] — typed per-request storage.
12//! - [`error`] — unified [`Error`] enum and safety-net conversion.
13//! - [`auth`] — identity in context, `require_auth` / `require_admin` helpers.
14//! - [`orm`] — SQLite-backed [`Model`] trait with `find` / `all` / `create` / `update` / `delete`.
15//! - [`admin`] — auto-generated CRUD UI for structs deriving [`RustioAdmin`].
16//! - [`migrations`] — versioned `.sql` files tracked in `rustio_migrations`.
17//! - [`server`] — hyper-backed [`Server`] that serves a router.
18
19pub mod admin;
20pub mod ai;
21pub mod auth;
22pub mod context;
23pub mod defaults;
24pub mod error;
25pub mod http;
26pub mod middleware;
27pub mod migrations;
28pub mod orm;
29pub mod router;
30pub mod schema;
31pub mod server;
32
33pub use auth::Identity;
34// Re-export the chrono types user models reach for. This lets generated
35// and user code write `use rustio_core::{DateTime, Utc};` without adding
36// chrono to their own `Cargo.toml`.
37pub use chrono::{DateTime, Utc};
38pub use context::Context;
39pub use error::{resolve, Error};
40pub use http::{html, json_raw, status_text, text, FormData, Request, Response};
41pub use middleware::Next;
42pub use orm::{Db, Model, Row, Value};
43pub use router::{Params, Router};
44pub use rustio_macros::RustioAdmin;
45pub use schema::Schema;
46pub use server::Server;