Trait yarn_spool::YarnHandler[][src]

pub trait YarnHandler {
    fn say(&mut self, text: String);
fn choose(&mut self, text: String, choices: Vec<String>);
fn command(&mut self, action: String) -> Result<(), ()>;
fn end_conversation(&mut self); }

A handler for Yarn actions that require integration with the embedder. Invoked synchronously during Yarn execution when matching steps are evaluated.

Required Methods

Present a line of dialogue without any choices. Execution will not resume until YarnEngine::proceed is invoked.

Present a line of dialogue with subsequent choices. Execution will not resume until YarnEngine::choose is invoked.

Instruct the embedder to perform some kind of action. The given action string is passed unmodified from the node source.

End the current conversation. Execution will not resume until a new node is made active with YarnEngine::activate.

Implementors