Enum naia_server::Event[][src]

pub enum Event<P: ProtocolType, E> {
    Authorization(UserKey, P),
    Connection(UserKey),
    Disconnection(UserKeyUser),
    Tick,
    Message(UserKey, P),
    Command(UserKey, E, 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

Tuple Fields of Authorization

0: UserKey1: P
Connection(UserKey)

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

Tuple Fields of Connection

0: UserKey
Disconnection(UserKeyUser)

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

Tuple Fields of Disconnection

0: UserKey1: User
Tick

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

Message(UserKey, P)

A Message emitted to the Server from a Client

Tuple Fields of Message

0: UserKey1: P
Command(UserKey, E, P)

A Command emitted to the Server from a Client, related to some user-assigned Entity

Tuple Fields of Command

0: UserKey1: E2: P

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

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

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.