Command

Trait Command 

Source
pub trait Command:
    Any
    + Debug
    + DynClone
    + 'static {
    // Required methods
    fn as_any(&self) -> &dyn Any;
    fn exec<'fut>(
        &'fut self,
        ctx: &'fut mut ExecContext<'_>,
        args: &'fut [String],
    ) -> Pin<Box<dyn Future<Output = ()> + 'fut>>;

    // Provided method
    fn description(&self) -> Option<&str> { ... }
}
Expand description

An executable command-like object.

Builtins and user functions are all its instances.

It must be cheaply clone-able.

Required Methods§

Source

fn as_any(&self) -> &dyn Any

Source

fn exec<'fut>( &'fut self, ctx: &'fut mut ExecContext<'_>, args: &'fut [String], ) -> Pin<Box<dyn Future<Output = ()> + 'fut>>

Provided Methods§

Implementors§