pub trait SimpleCommand {
// Required methods
fn get_content(
name: &str,
content_type: ContentType,
) -> Result<String, Error>;
fn execute(
context: ExecutionContext<'_>,
args: &[&str],
) -> Result<BuiltinResult, Error>;
}Expand description
A simple command that can be registered as a built-in.
Required Methods§
Sourcefn get_content(name: &str, content_type: ContentType) -> Result<String, Error>
fn get_content(name: &str, content_type: ContentType) -> Result<String, Error>
Returns the content of the built-in command.
Sourcefn execute(
context: ExecutionContext<'_>,
args: &[&str],
) -> Result<BuiltinResult, Error>
fn execute( context: ExecutionContext<'_>, args: &[&str], ) -> Result<BuiltinResult, Error>
Executes the built-in command.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.