Skip to main content

Event

Trait Event 

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

Source

const ADDRESS: &'static str

Where it’s emitted after the game did it.

Source

const PRE: Option<&'static str>

Where it’s emitted before — a handler’s cancel stops it — if it can be stopped.

Source

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§

Source

fn key(&self) -> Option<&str>

The key field’s value, if it’s keyed.

Source

fn address(&self) -> u32

Event::target’s number — the type’s own address cached.

Source

fn pre_address(&self) -> Option<u32>

Event::pre_target’s number.

Provided Methods§

Source

fn target(&self) -> String

Where this event goes after the game did it: the address, or its branch for the key.

Source

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

Implementors§

Source§

impl Event for Advancement

Source§

const ADDRESS: &'static str = ids::event_player_progress::ADVANCEMENT

Source§

const PRE: Option<&'static str> = None

Source§

const KEY: Option<&'static str> = None

Source§

impl Event for Attack

Source§

const ADDRESS: &'static str = ids::event_player_action::ATTACK

Source§

const PRE: Option<&'static str> = None

Source§

const KEY: Option<&'static str> = None

Source§

impl Event for Binding

Source§

const ADDRESS: &'static str = ids::event_client_input::BINDING

Source§

const PRE: Option<&'static str> = None

Source§

const KEY: Option<&'static str>

Source§

impl Event for Body

Source§

const ADDRESS: &'static str = ids::event_client_render::BODY

Source§

const PRE: Option<&'static str> = None

Source§

const KEY: Option<&'static str> = None

Source§

impl Event for Break

Source§

const ADDRESS: &'static str = ids::event_block::BREAK

Source§

const PRE: Option<&'static str>

Source§

const KEY: Option<&'static str> = None

Source§

impl Event for Camera

Source§

const ADDRESS: &'static str = ids::event_client_render::CAMERA

Source§

const PRE: Option<&'static str> = None

Source§

const KEY: Option<&'static str> = None

Source§

impl Event for yog_api::event::container::Close

Source§

const ADDRESS: &'static str = ids::event_container::CLOSE

Source§

const PRE: Option<&'static str> = None

Source§

const KEY: Option<&'static str> = None

Source§

impl Event for yog_api::client::ui::Close

Source§

const ADDRESS: &'static str = ids::event_client_ui::CLOSE

Source§

const PRE: Option<&'static str> = None

Source§

const KEY: Option<&'static str> = None

Source§

impl Event for yog_api::player::action::Craft

Source§

const ADDRESS: &'static str = ids::event_player_action::CRAFT

Source§

const PRE: Option<&'static str> = None

Source§

const KEY: Option<&'static str> = None

Source§

impl Event for yog_api::event::container::machine::Craft

Source§

const ADDRESS: &'static str = ids::event_container_machine::CRAFT

Source§

const PRE: Option<&'static str>

Source§

const KEY: Option<&'static str> = None

Source§

impl Event for Damage

Source§

const ADDRESS: &'static str = ids::event_entity_combat::DAMAGE

Source§

const PRE: Option<&'static str>

Source§

const KEY: Option<&'static str> = None

Source§

impl Event for yog_api::player::life::Death

Source§

const ADDRESS: &'static str = ids::event_player_life::DEATH

Source§

const PRE: Option<&'static str>

Source§

const KEY: Option<&'static str> = None

Source§

impl Event for yog_api::entity::life::Death

Source§

const ADDRESS: &'static str = ids::event_entity_life::DEATH

Source§

const PRE: Option<&'static str> = None

Source§

const KEY: Option<&'static str> = None

Source§

impl Event for Explosion

Source§

const ADDRESS: &'static str = ids::event_world::EXPLOSION

Source§

const PRE: Option<&'static str>

Source§

const KEY: Option<&'static str> = None

Source§

impl Event for GeneratedChunk

Source§

const ADDRESS: &'static str = ids::event_world_generation::CHUNK

Source§

const PRE: Option<&'static str> = None

Source§

const KEY: Option<&'static str>

Source§

impl Event for Hud

Source§

const ADDRESS: &'static str = ids::event_client_render::HUD

Source§

const PRE: Option<&'static str> = None

Source§

const KEY: Option<&'static str> = None

Source§

impl Event for Input

Source§

const ADDRESS: &'static str = ids::event_client_ui::INPUT

Source§

const PRE: Option<&'static str>

Source§

const KEY: Option<&'static str>

Source§

impl Event for Interact

Source§

const ADDRESS: &'static str = ids::event_player_action::INTERACT

Source§

const PRE: Option<&'static str>

Source§

const KEY: Option<&'static str> = None

Source§

impl Event for Join

Source§

const ADDRESS: &'static str = ids::event_player_session::JOIN

Source§

const PRE: Option<&'static str> = None

Source§

const KEY: Option<&'static str> = None

Source§

impl Event for Key

Source§

const ADDRESS: &'static str = ids::event_client_input::KEY

Source§

const PRE: Option<&'static str>

Source§

const KEY: Option<&'static str> = None

Source§

impl Event for Leave

Source§

const ADDRESS: &'static str = ids::event_player_session::LEAVE

Source§

const PRE: Option<&'static str> = None

Source§

const KEY: Option<&'static str> = None

Source§

impl Event for Loot

Source§

const ADDRESS: &'static str = ids::event_world_loot::ROLL

Source§

const PRE: Option<&'static str> = None

Source§

const KEY: Option<&'static str> = None

Source§

impl Event for Message

Source§

const ADDRESS: &'static str = ids::event_player_chat::MESSAGE

Source§

const PRE: Option<&'static str>

Source§

const KEY: Option<&'static str> = None

Source§

impl Event for Move

Source§

const ADDRESS: &'static str = ids::event_player_action::MOVE

Source§

const PRE: Option<&'static str> = None

Source§

const KEY: Option<&'static str> = None

Source§

impl Event for yog_api::event::container::Open

Source§

const ADDRESS: &'static str = ids::event_container::OPEN

Source§

const PRE: Option<&'static str>

Source§

const KEY: Option<&'static str> = None

Source§

impl Event for yog_api::client::ui::Open

Source§

const ADDRESS: &'static str = ids::event_client_ui::OPEN

Source§

const PRE: Option<&'static str> = None

Source§

const KEY: Option<&'static str> = None

Source§

impl Event for yog_api::PacketEvent

Source§

const ADDRESS: &'static str = ids::event_server_net::PACKET

Source§

const PRE: Option<&'static str> = None

Source§

const KEY: Option<&'static str>

Source§

impl Event for yog_api::ClientPacketEvent

Source§

const ADDRESS: &'static str = ids::event_client_net::PACKET

Source§

const PRE: Option<&'static str> = None

Source§

const KEY: Option<&'static str>

Source§

impl Event for Page

Source§

const ADDRESS: &'static str = ids::event_client_render::PAGE

Source§

const PRE: Option<&'static str> = None

Source§

const KEY: Option<&'static str>

Source§

impl Event for Pickup

Source§

const ADDRESS: &'static str = ids::event_player_action::PICKUP

Source§

const PRE: Option<&'static str>

Source§

const KEY: Option<&'static str> = None

Source§

impl Event for Place

Source§

const ADDRESS: &'static str = ids::event_block::PLACE

Source§

const PRE: Option<&'static str>

Source§

const KEY: Option<&'static str> = None

Source§

impl Event for ProjectileHit

Source§

const ADDRESS: &'static str = ids::event_entity_combat::PROJECTILE_HIT

Source§

const PRE: Option<&'static str>

Source§

const KEY: Option<&'static str> = None

Source§

impl Event for Record

Source§

const ADDRESS: &'static str = ids::event_log::RECORD

Source§

const PRE: Option<&'static str> = None

Source§

const KEY: Option<&'static str> = None

Source§

impl Event for Respawn

Source§

const ADDRESS: &'static str = ids::event_player_life::RESPAWN

Source§

const PRE: Option<&'static str> = None

Source§

const KEY: Option<&'static str> = None

Source§

impl Event for Run

Source§

const ADDRESS: &'static str = ids::event_server_command::RUN

Source§

const PRE: Option<&'static str> = None

Source§

const KEY: Option<&'static str>

Source§

impl Event for Saving

Source§

const ADDRESS: &'static str = ids::event_server_life::SAVING

Source§

const PRE: Option<&'static str> = None

Source§

const KEY: Option<&'static str> = None

Source§

impl Event for Spawn

Source§

const ADDRESS: &'static str = ids::event_entity_life::SPAWN

Source§

const PRE: Option<&'static str>

Source§

const KEY: Option<&'static str> = None

Source§

impl Event for Started

Source§

const ADDRESS: &'static str = ids::event_server_life::STARTED

Source§

const PRE: Option<&'static str> = None

Source§

const KEY: Option<&'static str> = None

Source§

impl Event for Stopping

Source§

const ADDRESS: &'static str = ids::event_server_life::STOPPING

Source§

const PRE: Option<&'static str> = None

Source§

const KEY: Option<&'static str> = None

Source§

impl Event for yog_api::entity::game::Tick

Source§

const ADDRESS: &'static str = ids::event_entity_game::TICK

Source§

const PRE: Option<&'static str> = None

Source§

const KEY: Option<&'static str>

Source§

impl Event for yog_api::event::server::game::Tick

Source§

const ADDRESS: &'static str = ids::event_server_game::TICK

Source§

const PRE: Option<&'static str> = None

Source§

const KEY: Option<&'static str> = None

Source§

impl Event for yog_api::client::game::Tick

Source§

const ADDRESS: &'static str = ids::event_client_game::TICK

Source§

const PRE: Option<&'static str> = None

Source§

const KEY: Option<&'static str> = None

Source§

impl Event for Tooltip

Source§

const ADDRESS: &'static str = ids::event_client_render::TOOLTIP

Source§

const PRE: Option<&'static str> = None

Source§

const KEY: Option<&'static str>

Source§

impl Event for Travel

Source§

const ADDRESS: &'static str = ids::event_client_game::TRAVEL

Source§

const PRE: Option<&'static str> = None

Source§

const KEY: Option<&'static str> = None

Source§

impl Event for Ui

Source§

const ADDRESS: &'static str = ids::event_client_render::UI

Source§

const PRE: Option<&'static str> = None

Source§

const KEY: Option<&'static str>

Source§

impl Event for Use

Source§

const ADDRESS: &'static str = ids::event_block::USE

Source§

const PRE: Option<&'static str>

Source§

const KEY: Option<&'static str> = None

Source§

impl Event for UseItem

Source§

const ADDRESS: &'static str = ids::event_player_action::USE_ITEM

Source§

const PRE: Option<&'static str>

Source§

const KEY: Option<&'static str> = None

Source§

impl Event for World

Source§

const ADDRESS: &'static str = ids::event_client_render::WORLD

Source§

const PRE: Option<&'static str> = None

Source§

const KEY: Option<&'static str> = None