pub trait NativeCommand: Send + Sync {
// Required methods
fn command(&self) -> Command;
fn execute(
&self,
args: &[String],
context: &NativeCommandContext<'_>,
) -> Result<NativeCommandOutcome>;
// Provided methods
fn auth(&self) -> Option<DescribeCommandAuthV1> { ... }
fn describe(&self) -> DescribeCommandV1 { ... }
}Expand description
Trait implemented by in-process commands registered alongside plugins.
Required Methods§
Sourcefn execute(
&self,
args: &[String],
context: &NativeCommandContext<'_>,
) -> Result<NativeCommandOutcome>
fn execute( &self, args: &[String], context: &NativeCommandContext<'_>, ) -> Result<NativeCommandOutcome>
Executes the command using already-parsed argument tokens.
Provided Methods§
Sourcefn auth(&self) -> Option<DescribeCommandAuthV1>
fn auth(&self) -> Option<DescribeCommandAuthV1>
Returns optional auth/visibility metadata for the command.
Sourcefn describe(&self) -> DescribeCommandV1
fn describe(&self) -> DescribeCommandV1
Builds the plugin-protocol style description for this command.