pub trait KnowledgeBaseCliExtension: KnowledgeBaseExtension {
// Required methods
fn command(&self) -> Command;
fn requires_repository(&self, matches: &ArgMatches) -> bool;
fn execute(
&self,
matches: &ArgMatches,
context: ExtensionCommandContext<'_>,
) -> Result<ExitCode, CliError>;
}Expand description
Optional CLI behavior for one statically compiled extension.
Required Methods§
Sourcefn requires_repository(&self, matches: &ArgMatches) -> bool
fn requires_repository(&self, matches: &ArgMatches) -> bool
Whether the selected command requires a configured and activated repository.
Sourcefn execute(
&self,
matches: &ArgMatches,
context: ExtensionCommandContext<'_>,
) -> Result<ExitCode, CliError>
fn execute( &self, matches: &ArgMatches, context: ExtensionCommandContext<'_>, ) -> Result<ExitCode, CliError>
Executes a parsed extension command.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".