pub trait CliCommand: Sized {
type Global: 'static;
// Required methods
fn parse() -> Result<Self>;
fn global() -> &'static Self::Global
where Self::Global: Sized;
fn help();
}Expand description
Implemented by #[derive(CliCommand)] on enums.
§Note on global()
Global options are stored in a process-wide std::sync::OnceLock
set during parse(). Safe for CLI utilities. For libraries or tests
that call parse() multiple times in the same process, pass the global
options explicitly instead of relying on global().
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".