Trait texttale::TextTale

source ·
pub trait TextTale: Write {
    // Required methods
    fn unexpected_eof(&mut self);
    fn get_prompt(&mut self) -> &'static str;
    fn set_prompt(&mut self, prompt: &'static str);
    fn next_command(&mut self) -> Option<String>;
}
Expand description

A TextTale creates a text-mode adventure by feeding the next command from the command prompt as a string. Will return None when the user kills the session or the underlying writer is exhausted.

Required Methods§

source

fn unexpected_eof(&mut self)

Handle an unexpected EOF.

source

fn get_prompt(&mut self) -> &'static str

Get the current prompt.

source

fn set_prompt(&mut self, prompt: &'static str)

Set the current prompt.

source

fn next_command(&mut self) -> Option<String>

Return the next command, according to the texttale’s rules.

Implementors§