Trait eventbus::Event

source ·
pub trait Event: 'static {
    fn cancellable(&self) -> bool { ... }
    fn cancelled(&self) -> bool { ... }
    fn set_cancelled(&mut self, cancel: bool) { ... }
}
Expand description

Basic trait for defining an event.

Provided Methods

Returns whether this event is cancellable.

When this is true, cancelled and cancel should also be implemented.

Note: While this method does take a &self, it’s a logic error for an event’s cancellability to change based on its value. The &self is just for trait objectification. You have been warned!

Returns whether this event has been cancelled.

Sets whether this event is cancelled.

Panics

Panics if this event is not cancellable.

Implementors