Trait Event

pub trait Event:
    Serialize
    + DeserializeOwned
    + Eq
    + Clone
    + Debug
    + Display
    + 'static
    + Send
    + Sync {
    // Required methods
    fn is_client(&self) -> bool;
    fn is_sync(&self) -> bool;
}
Expand description

Event that can change [state][crate::state::State] and emit other events

Note: if it doesn’t implement associative operation over some part of state, then this part of state shouldn’t be changed from outside otherwise data changes can be lost (data race between outside changes and connection changes)

Required Methods§

fn is_client(&self) -> bool

If true then this event can be emitted by the client.

fn is_sync(&self) -> bool

If true then this event requires DB context (sync handler). Used by the server-authoritative pipeline to route events.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§