pub trait EventPattern:
Send
+ Sync
+ 'static {
type Event: Event;
type Components: Bundle;
}Expand description
Trait for types that can be ‘matched’ on by Observers to register additional
metadata for an Event trigger. All Events are also implicitly
EventPatterns, but this trait can be manually implemented.
The following are lifecycle EventPatterns that register components
to watch for via their generic Bundle type parameter:
Required Associated Types§
Sourcetype Components: Bundle
type Components: Bundle
Components to watch for this event. This is used by EntityComponentsTrigger
to determine which entities to run observers for.
See EntityComponentsTrigger for more info.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".