Enum naia_server::Event
source · [−]pub enum Event<P: ProtocolType, E> {
Authorization(UserKey, P),
Connection(UserKey),
Disconnection(UserKey, User),
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
Connection(UserKey)
Occurs when a new Client has successfully established a connection with the Server
Disconnection(UserKey, User)
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, P)
A Message emitted to the Server from a Client
Command(UserKey, E, P)
A Command emitted to the Server from a Client, related to some user-assigned Entity
Auto Trait Implementations
impl<P, E> RefUnwindSafe for Event<P, E> where
E: RefUnwindSafe,
P: RefUnwindSafe,
impl<P, E> Send for Event<P, E> where
E: Send,
impl<P, E> Sync for Event<P, E> where
E: Sync,
impl<P, E> Unpin for Event<P, E> where
E: Unpin,
P: Unpin,
impl<P, E> UnwindSafe for Event<P, E> where
E: UnwindSafe,
P: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more