[][src]Trait endbasic::Console

pub trait Console {
    fn input(&mut self, prompt: &str) -> Fallible<String>;
fn print(&mut self, text: &str) -> Fallible<()>; }

Hooks to implement the INPUT and PRINT builtins.

Required methods

fn input(&mut self, prompt: &str) -> Fallible<String>

Writes prompt to the console and returns a single line of text input by the user.

The text provided by the user should not be validated in any way before return, as type validation and conversions happen within the Machine.

fn print(&mut self, text: &str) -> Fallible<()>

Writes text to the console.

Loading content...

Implementors

Loading content...