Trait MutEventSubscriber

Source
pub trait MutEventSubscriber {
    // Required methods
    fn process(&mut self, events: Events, ops: &mut EventOps<'_>);
    fn init(&mut self, ops: &mut EventOps<'_>);
}
Expand description

Allows the interaction between an EventManager and different event subscribers. Methods are invoked with a mutable self borrow.

Required Methods§

Source

fn process(&mut self, events: Events, ops: &mut EventOps<'_>)

Process events triggered in the event manager loop.

Optionally, the subscriber can use ops to update the events it monitors.

Source

fn init(&mut self, ops: &mut EventOps<'_>)

Initialization called by the EventManager when the subscriber is registered.

The subscriber is expected to use ops to register the events it wants to monitor.

Implementations on Foreign Types§

Source§

impl<T> MutEventSubscriber for Box<T>

Source§

fn process(&mut self, events: Events, ops: &mut EventOps<'_>)

Source§

fn init(&mut self, ops: &mut EventOps<'_>)

Source§

impl<T> MutEventSubscriber for Rc<T>
where T: EventSubscriber + ?Sized,

Source§

fn process(&mut self, events: Events, ops: &mut EventOps<'_>)

Source§

fn init(&mut self, ops: &mut EventOps<'_>)

Source§

impl<T> MutEventSubscriber for Arc<T>
where T: EventSubscriber + ?Sized,

Source§

fn process(&mut self, events: Events, ops: &mut EventOps<'_>)

Source§

fn init(&mut self, ops: &mut EventOps<'_>)

Source§

impl<T> MutEventSubscriber for RefCell<T>

Source§

fn process(&mut self, events: Events, ops: &mut EventOps<'_>)

Source§

fn init(&mut self, ops: &mut EventOps<'_>)

Source§

impl<T> MutEventSubscriber for Mutex<T>

Source§

fn process(&mut self, events: Events, ops: &mut EventOps<'_>)

Source§

fn init(&mut self, ops: &mut EventOps<'_>)

Implementors§