Trait gosh_repl::Actionable

source ·
pub trait Actionable {
    type Command: Parser;

    // Required method
    fn act_on(&mut self, cmd: &Self::Command) -> Result<bool>;

    // Provided method
    fn try_parse_from<I, T>(iter: I) -> Result<Self::Command>
       where I: IntoIterator<Item = T>,
             T: Into<OsString> + Clone { ... }
}
Expand description

Defines actions for REPL commands

Required Associated Types§

source

type Command: Parser

Required Methods§

source

fn act_on(&mut self, cmd: &Self::Command) -> Result<bool>

Take action on REPL commands. Return Ok(true) will exit shell loop.

Provided Methods§

source

fn try_parse_from<I, T>(iter: I) -> Result<Self::Command>where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

parse Command from shell line input.

Implementors§