Struct event::EventPublisher
[−]
[src]
pub struct EventPublisher<E> { /* fields omitted */ }
EventPublisher. Works similarly to C#'s event publishing pattern. Event handling functions are subscribed to the publisher.
Whenever the publisher fires an event it calls all subscribed event handler functions.
Use event::EventPublisher::
Methods
impl<E> EventPublisher<E>
[src]
fn new() -> EventPublisher<E>
Event publisher constructor.
fn subscribe_handler(&mut self, handler: fn(_: &Event<E>))
Subscribes event handler functions to the EventPublisher.
INPUT: handler: fn(&Event
fn unsubscribe_handler(&mut self, handler: fn(_: &Event<E>)) -> bool
Unsubscribes an event handler from the publisher.
INPUT: handler: fn(&Event
fn publish_event(&self, event: &Event<E>)
Publishes events, pushing the &Event