Command

Trait Command 

Source
pub trait Command<T: Terminal> {
    type Context;
    type Error;

    // Required method
    fn apply(
        &mut self,
        looper: &mut Looper<'_, Self::Context, Self::Error, T>,
    ) -> Result<ApplyOutcome, ApplyCommandError<Self::Error>>;
}
Expand description

The definition of an executable command.

T is the terminal type.

Required Associated Types§

Source

type Context

The application context type. (The part of the application this is not the REPL library.)

Source

type Error

The type of error that can be produced by the execution of the command.

Required Methods§

Source

fn apply( &mut self, looper: &mut Looper<'_, Self::Context, Self::Error, T>, ) -> Result<ApplyOutcome, ApplyCommandError<Self::Error>>

Applies the command for the given Looper. References to the underlying application context and the terminal interface are supplied by the Looper.

§Errors

ApplyCommandError if the command could not be executed.

Implementors§

Source§

impl<C, E, T: Terminal> Command<T> for Help<C, E>

Source§

impl<C, E, T: Terminal> Command<T> for Quit<C, E>