pub trait Runnable: Sized + Default + New {
    type Err: ErrorDisplay;
    type Errs: MultiErrorDisplay<Self::Err>;

    const NAME: &'static str;
Show 16 methods // Required methods fn cfg(&self) -> &ErgConfig; fn cfg_mut(&mut self) -> &mut ErgConfig; fn finish(&mut self); fn initialize(&mut self); fn clear(&mut self); fn eval(&mut self, src: String) -> Result<String, Self::Errs>; fn exec(&mut self) -> Result<ExitStatus, Self::Errs>; // Provided methods fn expect_block(&self, src: &str) -> BlockKind { ... } fn input(&self) -> &Input { ... } fn set_input(&mut self, input: Input) { ... } fn start_message(&self) -> String { ... } fn ps1(&self) -> String { ... } fn ps2(&self) -> String { ... } fn quit(&mut self, code: i32) -> ! { ... } fn quit_successfully(&mut self, output: BufWriter<StdoutLock<'_>>) -> ! { ... } fn run(cfg: ErgConfig) -> ExitStatus { ... }
}
Expand description

This trait implements REPL (Read-Eval-Print-Loop) automatically The exec method is called for file input, etc.

Required Associated Types§

Required Associated Constants§

source

const NAME: &'static str

Required Methods§

source

fn cfg(&self) -> &ErgConfig

source

fn cfg_mut(&mut self) -> &mut ErgConfig

source

fn finish(&mut self)

source

fn initialize(&mut self)

Erase all but immutable information.

source

fn clear(&mut self)

Erase information that will no longer be meaningful in the next iteration

source

fn eval(&mut self, src: String) -> Result<String, Self::Errs>

source

fn exec(&mut self) -> Result<ExitStatus, Self::Errs>

Provided Methods§

source

fn expect_block(&self, src: &str) -> BlockKind

source

fn input(&self) -> &Input

source

fn set_input(&mut self, input: Input)

source

fn start_message(&self) -> String

source

fn ps1(&self) -> String

source

fn ps2(&self) -> String

source

fn quit(&mut self, code: i32) -> !

source

fn quit_successfully(&mut self, output: BufWriter<StdoutLock<'_>>) -> !

source

fn run(cfg: ErgConfig) -> ExitStatus

Object Safety§

This trait is not object safe.

Implementors§