pub struct Event<EVT: 'static + Send + Sync> { /* private fields */ }Expand description
Container for event. The main purpose of this container is to ensure correct order of events. Asyncronous send_event function finishes only when all copies of Event are destroyed. This allows to guarantee that sent event have been processed by all handlers by the moment when send_event returns.
Event object is created as output of EventStream. There is no other way to create it.
Function which handles Event object may produce new events by calling send_event. Sometimes it’s necessary to
ensure that these derived events are handled before new instance of source event is produced. For example if mouse
click produces button press event, we have to be sure that button press event is handled before next mouse click arrives.
To do it the second parameter source of send_event is used. Reference to source event is stored into sent event.