pub trait SimpleCommand {
// Required methods
fn get_content(
name: &str,
content_type: ContentType,
) -> Result<String, Error>;
fn execute<I: Iterator<Item = S>, S: AsRef<str>>(
context: ExecutionContext<'_>,
args: I,
) -> Result<ExecutionResult, 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<I: Iterator<Item = S>, S: AsRef<str>>(
context: ExecutionContext<'_>,
args: I,
) -> Result<ExecutionResult, Error>
fn execute<I: Iterator<Item = S>, S: AsRef<str>>( context: ExecutionContext<'_>, args: I, ) -> Result<ExecutionResult, 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.