Skip to main content

Crate oxidite

Crate oxidite 

Source
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_core Application boot coordinator and configuration.
config_helper
Configuration helper utilities
cookie
Re-export all items from oxidite_core Backwards-compatible re-exports for cookies and form data. Backwards-compatible cookie/form module.
error
Re-export all items from oxidite_core Error types and the Result alias.
extract
Re-export the extract module from oxidite_core Request extractors (Json, Path, Query, State, Form, Cookies, Body, WebSocketUpgrade).
mpsc
Re-export all items from oxidite_core A multi-producer, single-consumer queue for sending values between asynchronous tasks.
prelude
Prelude module for common imports
request
Re-export all items from oxidite_core Extension trait for Request with body-reading helpers.
response
Re-export all items from oxidite_core Response constructors (json, text, html, helpers).
router
Re-export all items from oxidite_core HTTP router with path parameters, middleware, and CORS support.
server
Re-export all items from oxidite_core HTTP/1.1 server loop and body adapter.
tls
Re-export all items from oxidite_core TLS/HTTPS support and SecureServer. HTTPS and HTTP/2 support for Oxidite
types
Re-export all items from oxidite_core Type aliases for requests, responses, and boxed bodies.
versioning
Re-export all items from oxidite_core API versioning with ApiVersion and VersionedRouter. API Versioning support

Structs§

Application
Re-export all items from oxidite_core Application boot coordinator.
Body
Re-export all items from oxidite_core Extract raw request body as string
Cookies
Re-export all items from oxidite_core Extract cookies from the request
CorsConfig
Re-export all items from oxidite_core CORS configuration for the Router
Form
Re-export all items from oxidite_core Extract form data from the request body
HeaderMap
Re-export all items from oxidite_core A specialized multimap for header names and values.
HeaderValue
Re-export all items from oxidite_core Represents an HTTP header field value.
Json
Re-export all items from oxidite_core Extract and deserialize JSON request body
Method
Re-export all items from oxidite_core The Request Method (VERB)
OxiditeResponse
Re-export OxiditeRequest and OxiditeResponse The Oxidite HTTP response type.
Path
Re-export all items from oxidite_core Extract typed path parameters from the request
PathParams
Re-export all items from oxidite_core Storage for path parameters extracted during routing.
Query
Re-export all items from oxidite_core Extract typed query parameters from the request
Response
Re-export all items from oxidite_core The Oxidite HTTP response type.
Router
Re-export all items from oxidite_core The central request router.
Server
Re-export all items from oxidite_core HTTP server that listens for incoming connections and dispatches requests to a tower service.
State
Re-export all items from oxidite_core Extract application state from request extensions
StatusCode
Re-export all items from oxidite_core An HTTP status code (status-code in RFC 9110 et al.).
VersionedRouter
Re-export all items from oxidite_core Versioned router
WebSocketUpgrade
Re-export all items from oxidite_core Extractor for WebSocket upgrade requests

Enums§

ApiVersion
Re-export all items from oxidite_core API version
Error
Re-export all items from oxidite_core Error type for Oxidite applications.

Traits§

BodyExt
Re-export all items from oxidite_core An extension trait for http_body::Body adding various combinators and adapters
FromRequest
Re-export all items from oxidite_core Extractor trait - allows types to be extracted from requests.
Handler
Re-export all items from oxidite_core Trait for async functions that can be used as handlers
IntoHandler
Re-export all items from oxidite_core Trait that provides compile-time verification that a function is a valid handler.

Functions§

handler_fn
Re-export all items from oxidite_core Compile-time handler verification helper.
html
Re-export all items from oxidite_core Create an HTML response.
json
Re-export all items from oxidite_core Create a JSON response from any serializable value.
text
Re-export all items from oxidite_core Create a plain text response.

Type Aliases§

OxiditeRequest
Re-export OxiditeRequest and OxiditeResponse The Oxidite HTTP request type.
Request
Re-export all items from oxidite_core The Oxidite HTTP request type.
Result
Re-export all items from oxidite_core A specialized Result type for Oxidite applications