Enum naia_client::Event
source · [−]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
Auto Trait Implementations
impl<P, E, C> RefUnwindSafe for Event<P, E, C> where
C: RefUnwindSafe,
E: RefUnwindSafe,
P: RefUnwindSafe,
<P as Protocolize>::Kind: RefUnwindSafe,
impl<P, E, C> Send for Event<P, E, C> where
E: Send,
impl<P, E, C> Sync for Event<P, E, C> where
E: Sync,
impl<P, E, C> Unpin for Event<P, E, C> where
C: Unpin,
E: Unpin,
P: Unpin,
<P as Protocolize>::Kind: Unpin,
impl<P, E, C> UnwindSafe for Event<P, E, C> where
C: UnwindSafe,
E: UnwindSafe,
P: UnwindSafe,
<P as Protocolize>::Kind: 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