Skip to content

API Reference

Oxide is a set of Rust crates — the full API is documented inline via rustdoc. Generate it locally with a single command:

Terminal window
# From the framework repo root
cargo doc --no-deps --workspace --open
  • --no-deps — skips generating documentation for dependencies.
  • --workspace — includes every oxide-* crate.
  • --open — opens the rendered site in your default browser.

Output lands at target/doc/index.html. From there you can navigate to any published crate:

  • oxide — umbrella crate. Modules: core (IoC + scheduler + time), config, http, db (incl. lifecycle)
  • oxide_auth — Sanctum-style tokens, Hash, abilities, auth_middleware
  • oxide_macros#[controller], #[api_resource], #[injectable], #[request], #[get/post/put/patch/delete] markers
  • oxide_cli — CLI binary entry points

Frequently-used public surface

Quick map from concept → import path. The full type signatures live in rustdoc.

ConceptImport
App + bootstrapoxide::http::prelude::*
Container resolveoxide::Container, oxide::FromContainer
Configoxide::{Config, config, config_set}
HTTPoxide::http::{Request, Response, IntoResponse, Middleware, Next}
DB default connoxide::db::{conn, Database, Model}
DB named connoxide::db::DB (DB::connection("mysql2"))
Lifecycle hooksoxide::lifecycle::{HasUuid, HasTimestamps}
Lifecycle macrooxide::model_behavior!
Time / timezoneoxide::time::{now, now_in_tz, now_naive, tz, utc_now}
Auth (opt-in)oxide_auth::{Auth, Authenticatable, HasApiTokens, Hash, auth_middleware, abilities, ability}
Console commandsoxide::Command
Scheduleroxide::Schedule, ServiceProvider::schedule
Error maskingResponse::server_error(e) / server_error_with(e, "msg")

Inside a consumer project

When you depend on Oxide as a git dep, you can still generate the API docs the same way — cargo will include oxide-* in the doc output:

Terminal window
cargo doc --no-deps --open

The crate docs appear under target/doc/oxide/, target/doc/oxide_auth/, etc.

Hosted rustdoc

Not currently served alongside this docs site. When Oxide publishes to crates.io the usual docs.rs rendering will be available for each crate. Until then, cargo doc --no-deps locally is the authoritative reference.

The source is the specification

Every public type, function, and macro carries a rustdoc comment. Where this guide and the rustdoc differ, the rustdoc is authoritative — it is generated from the same source that cargo compiles.