Expand description
Main host-facing entrypoints, runtime state, and session types. The app module exists to turn the library pieces into a running program.
This is the process-facing layer of the crate. It wires together CLI
parsing, config loading, plugin/catalog setup, rendering, and REPL startup
into the public App entrypoints. Lower-level modules like
crate::config, crate::ui, and crate::repl stay reusable because
this module is where the product-level orchestration happens.
Contract:
- this is allowed to depend on the rest of the crate because it is the host composition layer
- the dependency should not point the other way; lower-level modules should
not import
crate::appto get work done
Public API shape:
- most callers should start with
ApporAppBuilder - embedders may inspect runtime/session state, but the preferred
construction path still flows through builders and constructors here such
as
crate::app::AppStateBuilder,crate::app::UiStateBuilder, andcrate::app::LaunchContextBuilder - lower-level semantic payloads live in modules like
crate::guideandcrate::completion; this module owns the heavier host machinery
Structs§
- App
- Top-level application entrypoint for CLI and REPL execution.
- AppBuilder
- Builder for configuring an
Appbefore construction. - AppClients
- Long-lived client registries shared across command execution.
- AppClients
Builder - Builder for
AppClients. - AppRunner
- Reusable runner that keeps an
Apppaired with a UI sink. - AppRuntime
- Runtime-scoped application state shared across commands.
- AppSession
- Session-scoped REPL state, caches, and prompt metadata.
- AppSession
Builder - Builder for
AppSession. - AppState
- Aggregate application state shared between runtime and session logic.
- AppState
Builder - Builder for
AppState. - Auth
State - Authorization and command-visibility state derived from configuration.
- Buffered
UiSink - Sink that buffers stdout and stderr for assertions and snapshot tests.
- Config
State - Holds the current resolved config plus a monotonic in-memory revision.
- Debug
Timing Badge - Timing badge rendered in the prompt for the most recent command.
- Debug
Timing State - Shared prompt-timing storage that dispatch code can update and prompt rendering can read.
- Last
Failure - Summary of the last failed REPL command.
- Launch
Context - Startup inputs used to assemble runtime services and locate on-disk state.
- Launch
Context Builder - Builder for
LaunchContext. - Repl
Scope Frame - One entered command scope inside the interactive REPL shell stack.
- Repl
Scope Stack - Nested REPL command-scope stack used for shell-style scoped interaction.
- Runtime
Context - Startup-time selection inputs that shape runtime config resolution.
- StdIo
UiSink - Sink that forwards output directly to the process stdio streams.
- UiState
- Derived presentation/runtime state for the active config snapshot.
- UiState
Builder - Builder for
UiState.
Enums§
- Terminal
Kind - Identifies which top-level host surface is currently active.
Traits§
- UiSink
- Terminal-facing output sink for stdout/stderr emission.
Functions§
- run_
from - Runs the top-level CLI entrypoint from an argv-like iterator.
- run_
process - Runs the default application instance and returns a process exit code.
- run_
process_ with_ sink - Runs the default application instance with the provided sink.