Skip to main content

Callbacks

Trait Callbacks 

Source
pub trait Callbacks {
    // Required methods
    fn call(&mut self, jobs: &mut Jobs, site: usize, f: Callback) -> bool;
    fn machine(&mut self, site: usize) -> &mut Machine;
}
Expand description

What a callback needs to run, borrowed from the town (see crate::town::Sim).

Required Methods§

Source

fn call(&mut self, jobs: &mut Jobs, site: usize, f: Callback) -> bool

Run a callback. Returns false to pass the state on to the previous controller.

Source

fn machine(&mut self, site: usize) -> &mut Machine

A site’s state machine.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Callbacks for Sim<'_, '_>