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-core
⚠️ Internal crate
Unless you know exactly what you are doing, there is probably no need to directly depend on this crate.
This crate contains core facades and utilities.
Structs§
- AppContext
- Facade representing the global (singleton) application context.
- AppReplica
- Exposes the ways for the application to introspect its own runtime replica, primarily via a numerical index (injected via the environment at runtime).
- AppSpindown
- A facade for interacting with the application’s global spindown registry.
- AppSpindown
Token - A token issued for every workload registered with
AppSpindownRegistry
. - Glued
- A wrapped
LifetimeId
that implementsDisplay
by writing the ID in an unbroken chunk. Writes exactly twelve ASCII characters. - Hyphenated
- A wrapped
LifetimeId
that implementsDisplay
by writing the ID in three chunks, separated by the hyphen characters. Writes exactly twelve ASCII characters. - Lifetime
Id - Ten pseudo-random lower-case ASCII letters with a few visually digestible string representations. Not cryptographically secure.
- Pivot
- Owns the logic for resolving the runtime pivot directory.
- Underscored
- A wrapped
LifetimeId
that implementsDisplay
by writing the ID in three chunks, separated by the underscore characters. Writes exactly twelve ASCII characters.
Enums§
- AppProfile
- 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 - Globally recognized field name that, when present in a
tracing
macro call, should trigger an event for an external alerting system.
Functions§
- strut_
shutdown - Terminates the global
AppContext
and waits forAppSpindown
to complete.