Skip to main content

Event

Trait Event 

Source
pub trait Event:
    Clone
    + Send
    + Sync
    + 'static { }
Expand description

Any plain Clone + Send + Sync + 'static value can be an event - a blanket impl, no derive, no required methods. Clone is required because each of possibly-several listeners for one dispatch gets its own owned copy to move into its independently-'static future.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T> Event for T
where T: Clone + Send + Sync + 'static,