Expand description
§Oxidite Web Framework
Oxidite is a modular web framework for Rust built on hyper and tokio.
It provides an integrated stack covering routing, ORM, authentication, real-time
communication, background jobs, caching, storage, templates, email, and OpenAPI
generation — all wired through a single CLI for scaffolding and development.
§Quick Start
[dependencies]
oxidite = { version = "2.3.4", features = ["full"] }
tokio = { version = "1", features = ["full"] }
serde = { version = "1", features = ["derive"] }use oxidite::prelude::*;
async fn hello(_req: Request) -> Result<Response> {
Ok(Response::text("Hello, Oxidite!"))
}
#[tokio::main]
async fn main() -> Result<()> {
let mut app = Application::new(Config::load().unwrap());
app.router_mut().get("/", hello);
app.run().await
}§Features
- HTTP Server: HTTP/1.1, HTTP/2, and WebSocket support
- Routing: Path parameters, query parsing, API versioning
- Middleware: CORS, logging, compression, rate limiting
- Database: ORM with relationships, migrations, soft deletes, eager loading
- Authentication: RBAC, JWT, OAuth2, 2FA, API keys
- Background Jobs: Cron scheduling, retry logic, dead letter queue
- Caching: Memory and Redis backends
- Real-time: WebSocket and SSE with event broadcasting
- Templates: Server-side rendering
- Email: SMTP support
- File Storage: Local and S3 backends
- Config: TOML-based config with namespaced env variables
Re-exports§
pub use config_helper::cors_layer_from_config;pub use oxidite_middleware as middleware;pub use oxidite_config as config;pub use oxidite_db as db;pub use oxidite_auth as auth;pub use oxidite_queue as queue;pub use oxidite_cache as cache;pub use oxidite_realtime as realtime;pub use oxidite_template as template;pub use oxidite_mail as mail;pub use oxidite_storage as storage;pub use oxidite_security as security;pub use oxidite_utils as utils;
Modules§
- app
- Re-export all items from
oxidite_coreApplication boot coordinator and configuration. - config_
helper - Configuration helper utilities
- cookie
- Re-export all items from
oxidite_coreBackwards-compatible re-exports for cookies and form data. Backwards-compatible cookie/form module. - error
- Re-export all items from
oxidite_coreError types and theResultalias. - extract
- Re-export the
extractmodule fromoxidite_coreRequest extractors (Json,Path,Query,State,Form,Cookies,Body,WebSocketUpgrade). - mpsc
- Re-export all items from
oxidite_coreA multi-producer, single-consumer queue for sending values between asynchronous tasks. - prelude
- Prelude module for common imports
- request
- Re-export all items from
oxidite_coreExtension trait forRequestwith body-reading helpers. - response
- Re-export all items from
oxidite_coreResponse constructors (json,text,html, helpers). - router
- Re-export all items from
oxidite_coreHTTP router with path parameters, middleware, and CORS support. - server
- Re-export all items from
oxidite_coreHTTP/1.1 server loop and body adapter. - tls
- Re-export all items from
oxidite_coreTLS/HTTPS support andSecureServer. HTTPS and HTTP/2 support for Oxidite - types
- Re-export all items from
oxidite_coreType aliases for requests, responses, and boxed bodies. - versioning
- Re-export all items from
oxidite_coreAPI versioning withApiVersionandVersionedRouter. API Versioning support
Structs§
- Application
- Re-export all items from
oxidite_coreApplication boot coordinator. - Body
- Re-export all items from
oxidite_coreExtract raw request body as string - Cookies
- Re-export all items from
oxidite_coreExtract cookies from the request - Cors
Config - Re-export all items from
oxidite_coreCORS configuration for the Router - Form
- Re-export all items from
oxidite_coreExtract form data from the request body - Header
Map - Re-export all items from
oxidite_coreA specialized multimap for header names and values. - Header
Value - Re-export all items from
oxidite_coreRepresents an HTTP header field value. - Json
- Re-export all items from
oxidite_coreExtract and deserialize JSON request body - Method
- Re-export all items from
oxidite_coreThe Request Method (VERB) - Oxidite
Response - Re-export
OxiditeRequestandOxiditeResponseThe Oxidite HTTP response type. - Path
- Re-export all items from
oxidite_coreExtract typed path parameters from the request - Path
Params - Re-export all items from
oxidite_coreStorage for path parameters extracted during routing. - Query
- Re-export all items from
oxidite_coreExtract typed query parameters from the request - Response
- Re-export all items from
oxidite_coreThe Oxidite HTTP response type. - Router
- Re-export all items from
oxidite_coreThe central request router. - Server
- Re-export all items from
oxidite_coreHTTP server that listens for incoming connections and dispatches requests to a tower service. - State
- Re-export all items from
oxidite_coreExtract application state from request extensions - Status
Code - Re-export all items from
oxidite_coreAn HTTP status code (status-codein RFC 9110 et al.). - Versioned
Router - Re-export all items from
oxidite_coreVersioned router - WebSocket
Upgrade - Re-export all items from
oxidite_coreExtractor for WebSocket upgrade requests
Enums§
- ApiVersion
- Re-export all items from
oxidite_coreAPI version - Error
- Re-export all items from
oxidite_coreError type for Oxidite applications.
Traits§
- BodyExt
- Re-export all items from
oxidite_coreAn extension trait forhttp_body::Bodyadding various combinators and adapters - From
Request - Re-export all items from
oxidite_coreExtractor trait - allows types to be extracted from requests. - Handler
- Re-export all items from
oxidite_coreTrait for async functions that can be used as handlers - Into
Handler - Re-export all items from
oxidite_coreTrait that provides compile-time verification that a function is a valid handler.
Functions§
- handler_
fn - Re-export all items from
oxidite_coreCompile-time handler verification helper. - html
- Re-export all items from
oxidite_coreCreate an HTML response. - json
- Re-export all items from
oxidite_coreCreate a JSON response from any serializable value. - text
- Re-export all items from
oxidite_coreCreate a plain text response.
Type Aliases§
- Oxidite
Request - Re-export
OxiditeRequestandOxiditeResponseThe Oxidite HTTP request type. - Request
- Re-export all items from
oxidite_coreThe Oxidite HTTP request type. - Result
- Re-export all items from
oxidite_coreA specialized Result type for Oxidite applications