pub trait Runner {
// Required method
fn run(&self, source: &str) -> Result<Box<dyn View>, Vec<CodeDiagnostic>>;
// Provided methods
fn take_output(&self) -> RunOutput { ... }
fn watch(&self, wake: Rc<dyn Fn()>) { ... }
}Expand description
What turns the code of a Playground into something to show.
It runs when the person asks, never on every frame, so it may take its time and build whatever it needs anew.
Required Methods§
Provided Methods§
Sourcefn take_output(&self) -> RunOutput
fn take_output(&self) -> RunOutput
What the code printed, and the problems of what it runs later, such as a closure on a click, since the last time this was asked. Nothing, unless the runner keeps them.
Sourcefn watch(&self, wake: Rc<dyn Fn()>)
fn watch(&self, wake: Rc<dyn Fn()>)
Calls wake whenever there is something new for Self::take_output, so the
playground shows it as it comes. Nothing, unless the runner can tell.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".