pub enum Event<P: Protocolize, E: Copy, C: ChannelIndex> {
    Connection(SocketAddr),
    Disconnection(SocketAddr),
    Tick,
    SpawnEntity(E),
    DespawnEntity(E),
    InsertComponent(E, P::Kind),
    UpdateComponent(Tick, E, P::Kind),
    RemoveComponent(E, P),
    Message(C, P),
}
Expand description

An Event that is be emitted by the Client, usually as a result of some communication with the Server

Variants

Connection(SocketAddr)

Occurs when the Client has successfully established a connection with the Server

Disconnection(SocketAddr)

Occurs when the Client has lost connection with the Server, usually as a result of a timeout

Tick

A Tick Event, the duration between Tick events is defined in the Config passed to the Client on initialization

SpawnEntity(E)

Occurs when an Entity on the Server has come into scope for the Client

DespawnEntity(E)

Occurs when an Entity on the Server has been destroyed, or left the Client’s scope

InsertComponent(E, P::Kind)

Occurs when a Component should be added to a given Entity

UpdateComponent(Tick, E, P::Kind)

Occurs when a Component has had a state change on the Server while the Entity it is attached to has come into scope for the Client

RemoveComponent(E, P)

Occurs when a Component should be removed from the given Entity

Message(C, P)

A Message emitted to the Client from the Server

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.