brush_core::builtins

Trait SimpleCommand

Source
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§

Source

fn get_content(name: &str, content_type: ContentType) -> Result<String, Error>

Returns the content of the built-in command.

Source

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.

Implementors§