Expand description
Compile-time client-state machine for CLI commands.
Each Commands arm dispatches to a BwCommand implementation
whose BwCommand::Client declares the auth/lock state required to run. The dispatcher in
main constructs a ClientContext once per invocation and routes the command
through the corresponding TryFrom extractor; commands therefore never check auth/lock state
manually.
Modules§
- sealed 🔒
Structs§
- AnyState
- Catch-all. The extractor is infallible.
- Client
Context - Per-invocation context built once in
process_commandsand consumed by a single extractor. - Locked
- Authenticated and locked. The extractor rejects an unlocked vault.
- Logged
In - Authenticated state, lock-status-agnostic. The extractor requires a user.
- Logged
Out - Unauthenticated state. The extractor rejects when a user is already logged in.
- Unlocked
- Authenticated and unlocked. The extractor requires the user’s symmetric key to be loaded.
Traits§
- BwCommand
- Trait implemented by commands that participate in the typestate dispatch.
- BwCommand
Ext - Extension trait that wires
BwCommandup to theClientContextdispatcher. - Client
State - Marker trait implemented by the five client-state types in this module.