pub trait Event: Message {
const ADDRESS: &'static str;
const PRE: Option<&'static str>;
const KEY: Option<&'static str>;
// Required methods
fn key(&self) -> Option<&str>;
fn address(&self) -> u32;
fn pre_address(&self) -> Option<u32>;
// Provided methods
fn target(&self) -> String { ... }
fn pre_target(&self) -> Option<String> { ... }
}Expand description
An event the bus carries; its payload is Self in yog-data’s binary form.
Required Associated Constants§
Sourceconst PRE: Option<&'static str>
const PRE: Option<&'static str>
Where it’s emitted before — a handler’s cancel stops it — if it can be stopped.
Sourceconst KEY: Option<&'static str>
const KEY: Option<&'static str>
The field whose value picks the event’s branch (entity_type: each
type’s ticks go to …/tick/<type>), if it’s keyed — see crate::keyed.
Required Methods§
Sourcefn address(&self) -> u32
fn address(&self) -> u32
Event::target’s number — the type’s own address cached.
Sourcefn pre_address(&self) -> Option<u32>
fn pre_address(&self) -> Option<u32>
Event::pre_target’s number.
Provided Methods§
Sourcefn target(&self) -> String
fn target(&self) -> String
Where this event goes after the game did it: the address, or its branch for the key.
Sourcefn pre_target(&self) -> Option<String>
fn pre_target(&self) -> Option<String>
Where it goes before, if it can be stopped.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".