Skip to main content

Crate rust_template_foundation

Crate rust_template_foundation 

Source
Expand description

Shared infrastructure for projects spawned from rust-template.

This crate extracts the generic plumbing (config loading, logging, health checks, metrics, OpenAPI, OIDC auth, systemd integration) so downstream projects consume it as a git dependency and receive improvements via cargo update.

§Feature flags

  • cliCommonConfigFile (file side of the CLI/file merge), CLI logging, CliApp trait, the MergeConfig derive (which generates CliRaw with per-app-prefixed env vars), and #[foundation_main].
  • server — Health registry, metrics endpoint, OpenAPI/Scalar helpers, SPA fallback, systemd notify/watchdog, server logging.
  • auth (implies server + cli) — OIDC login/callback/logout handlers, require_auth middleware, Server runner, ServerApp trait, and BaseServerState.

Modules§

config
Configuration file discovery and loading.
logging
Log level and format types shared across CLI and server crates.
prelude
Convenience re-exports used by most downstream crates.