start
Module: start
Section titled “Module: start”Contents
Section titled “Contents”Structs
StackHandle- Handle returned by [spawn_stack] and [start] once the stack has
Enums
StartMode- Mode in which [start] manages the stack after readiness.
Functions
spawn_stack- Spawn the stack and wait for readiness without blocking on supervision.start- Start the authority and sidecar stack.supervise- Run the detached supervisor loop.
firma_stack::start::StackHandle
Section titled “firma_stack::start::StackHandle”Struct
Handle returned by [spawn_stack] and [start] once the stack has
reached the ready state.
The handle is informational only: it does not own the children’s lifecycle
(pid files on disk are the source of truth). Callers tear the stack down
via [crate::stop].
Fields:
authority_pid: u32- PID of the authority component.sidecar_pid: u32- PID of the sidecar component.state_dir: std::path::PathBuf- Resolved state directory the stack is writing to.
firma_stack::start::StartMode
Section titled “firma_stack::start::StartMode”Enum
Mode in which [start] manages the stack after readiness.
Variants:
Foreground- Block in the calling thread, forwardingSIGINT/SIGTERM/Detached- Fork a hidden__supervisechild that takes over supervision and
Traits: Eq, Copy
Trait Implementations:
- Debug
fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result
- PartialEq
fn eq(self: &Self, other: &StartMode) -> bool
- Clone
fn clone(self: &Self) -> StartMode
firma_stack::start::spawn_stack
Section titled “firma_stack::start::spawn_stack”Function
Spawn the stack and wait for readiness without blocking on supervision.
Returns once both components are listening and the sidecar CA material is
on disk. The caller owns lifecycle: it must eventually call
[crate::stop] to tear the stack down (or rely on the OS reaping pids when
the parent process exits).
Used by firma-demo-tui and as the first step of [start].
Errors
Section titled “Errors”Returns state-directory, lock, spawn, or readiness errors. On failure after children have been spawned, this function tears them down and removes any pid/listen/lock files it created before returning the error.
fn spawn_stack(cfg: &crate::config::StackConfig, state_dir: &std::path::Path) -> crate::error::Result<StackHandle>firma_stack::start::start
Section titled “firma_stack::start::start”Function
Start the authority and sidecar stack.
Errors
Section titled “Errors”Returns state directory, spawn, readiness, or detach errors. On failure after children have been spawned, this function tears them down and removes any pid/listen/lock files it created before returning the error.
fn start(cfg: &crate::config::StackConfig, state_dir: &std::path::Path, mode: StartMode) -> crate::error::Result<StackHandle>firma_stack::start::supervise
Section titled “firma_stack::start::supervise”Function
Run the detached supervisor loop.
Errors
Section titled “Errors”Returns pidfile or supervision errors.
fn supervise(state_dir: &std::path::Path) -> crate::error::Result<()>