Expand description
Strut
Backend in Rust: convenient and configurable with Strut. 🏗️
- Strut is a Rust application scaffold that aims to simplify common backend chores.
- The documentation is available on the ➡️ homepage.
§Crate strut
This crate is the entrypoint crate of the workspace. Its main job is to transitively pull other Strut crates and to expose relevant public APIs.
Re-exports§
pub use tokio;
pub use strut_config as config;
Structs§
- App
- The primary entry point for launching a Strut application.
- AppConfig
- Represents the application’s externalized configuration.
- AppContext
- Re-exports the public API of
strut-core
in the root of this crate for convenience. Facade representing the global (singleton) application context. - AppReplica
- Re-exports the public API of
strut-core
in the root of this crate for convenience. Exposes the ways for the application to introspect its own runtime replica, primarily via a numerical index (injected via the environment at runtime). - AppSpindown
- Re-exports the public API of
strut-core
in the root of this crate for convenience. A facade for interacting with the application’s global spindown registry. - AppSpindown
Token - Re-exports the public API of
strut-core
in the root of this crate for convenience. A token issued for every workload registered withAppSpindownRegistry
. - DotEnv
- Re-exports the
DotEnv
facade. A facade for loading environment variables from.env
files. - Glued
- Re-exports the public API of
strut-core
in the root of this crate for convenience. A wrappedLifetimeId
that implementsDisplay
by writing the ID in an unbroken chunk. Writes exactly twelve ASCII characters. - Hyphenated
- Re-exports the public API of
strut-core
in the root of this crate for convenience. A wrappedLifetimeId
that implementsDisplay
by writing the ID in three chunks, separated by the hyphen characters. Writes exactly twelve ASCII characters. - Launchpad
- Configures and launches a Strut application.
- Lifetime
Id - Re-exports the public API of
strut-core
in the root of this crate for convenience. Ten pseudo-random lower-case ASCII letters with a few visually digestible string representations. Not cryptographically secure. - Pivot
- Re-exports the public API of
strut-core
in the root of this crate for convenience. Owns the logic for resolving the runtime pivot directory. - Underscored
- Re-exports the public API of
strut-core
in the root of this crate for convenience. A wrappedLifetimeId
that implementsDisplay
by writing the ID in three chunks, separated by the underscore characters. Writes exactly twelve ASCII characters.
Enums§
- AppConfig
Error - Re-exports the
AppConfig
-related types. A cloneable representation of a configuration error. - AppProfile
- Re-exports the public API of
strut-core
in the root of this crate for convenience. Represents the runtime profile of the application. The profile affects primarily which set of configuration files is applied, and the application is free to implement any profile-specific logic.
Constants§
- ALERT_
FIELD_ NAME - Re-exports the public API of
strut-core
in the root of this crate for convenience. Globally recognized field name that, when present in atracing
macro call, should trigger an event for an external alerting system.
Traits§
- Configuration
Wiring - Defines the configuration wiring stage of a Strut application.
- Preflight
Wiring - Defines the preflight wiring stage of a Strut application.
- Runtime
Wiring - Defines the runtime wiring stage of a Strut application.
Functions§
- strut_
shutdown - Re-exports the public API of
strut-core
in the root of this crate for convenience. Terminates the globalAppContext
and waits forAppSpindown
to complete.