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§
sourcefn unexpected_eof(&mut self)
fn unexpected_eof(&mut self)
Handle an unexpected EOF.
sourcefn get_prompt(&mut self) -> &'static str
fn get_prompt(&mut self) -> &'static str
Get the current prompt.
sourcefn set_prompt(&mut self, prompt: &'static str)
fn set_prompt(&mut self, prompt: &'static str)
Set the current prompt.
sourcefn next_command(&mut self) -> Option<String>
fn next_command(&mut self) -> Option<String>
Return the next command, according to the texttale’s rules.