pub enum Event<P: Protocolize, C: ChannelIndex> {
    Authorization(UserKey, P),
    Connection(UserKey),
    Disconnection(UserKeyUser),
    Tick,
    Message(UserKey, C, P),
}
Expand description

An Event that is emitted as a result of some communication with a Client, or a Tick event

Variants

Authorization(UserKey, P)

Occurs when a Client attempts to establish a connection with the Server. Used accept or reject incoming Clients

Connection(UserKey)

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

Disconnection(UserKeyUser)

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

Tick

A Tick Event. The duration between Tick events is defined in the Config passed to the Server on initialization

Message(UserKey, C, P)

A Message emitted to the Server from a Client

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.