Skip to main content

Crate standout_dispatch

Crate standout_dispatch 

Source
Expand description

Command dispatch and orchestration for clap-based CLIs.

Routes parsed ArgMatches to a Handler, running pre-dispatch, handler, post-dispatch, and post-output hooks around it, and returns typed HandlerResult data — presentation stays with the consuming framework. A handler adapter takes (&ArgMatches, &CommandContext) and returns serializable data, so application logic stays reusable outside a CLI.

CommandContext carries two kinds of injected state: app_state is immutable and app-lifetime (database, config, API clients), built once and shared via Rc; extensions is mutable and per-request, set by pre-dispatch hooks for things like a resolved user session.

Re-exports§

pub use artifact::Artifact;
pub use artifact::ArtifactDestination;
pub use artifact::ArtifactReceipt;
pub use artifact::ArtifactRun;

Modules§

artifact
verify

Structs§

AppFailure
ArtifactOutput
CommandContext
Diagnostic
DiagnosticPosition
DiagnosticRange
EntryStream
Envelope
ExitStatus
Extensions
ExternalFailure
FnHandler
HookError
Hooks
InvalidAppStatus
InvalidExternalStatus
RunError
RunOutput
SimpleFnHandler
StreamCapture
StreamSink
TextOutput

Enums§

DiagnosticKind
DispatchResult
HookPhase
Output
OutputKind
RenderedOutput
RunErrorKind
Severity
StreamError
SuccessKind

Traits§

ContractSurface
Handler
IntoHandlerResult

Functions§

extract_command_path
get_deepest_matches
has_subcommand
insert_default_command
path_to_string
string_to_path

Type Aliases§

HandlerResult
PostDispatchFn
PostOutputFn
PreDispatchFn