Skip to main content

EventPattern

Trait EventPattern 

Source
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§

Source

type Event: Event

The event type being observed.

Source

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".

Implementors§