Trait caminos_lib::event::Eventful[][src]

pub trait Eventful {
    fn process(&mut self, simulation: &Simulation<'_>) -> Vec<EventGeneration>;
fn pending_events(&self) -> usize;
fn add_pending_event(&mut self);
fn clear_pending_events(&mut self);
fn as_eventful(&self) -> Weak<RefCell<dyn Eventful>>; }
Expand description

A trait to be implemented for generic objects to be inserted in the event queue.

Required methods

Method to ve called to process the events.

Number of pending events.

Mark the eventful as having another pending event. It should also be added to some queue.

Mark the eventful as having no pending events. Perhaps it is not necessary, since it is being done by the process method.

Extract the eventful from the implementing class. Required since as Rc<RefCell<Eventful>> does not work.

Implementors