Enum ggrs::PlayerType
source · pub enum PlayerType<A>{
Local,
Remote(A),
Spectator(A),
}
Expand description
Defines the three types of players that GGRS considers:
- local players, who play on the local device,
- remote players, who play on other devices and
- spectators, who are remote players that do not contribute to the game input.
Both
PlayerType::Remote
andPlayerType::Spectator
have a socket address associated with them.
Variants§
Local
This player plays on the local device.
Remote(A)
This player plays on a remote device identified by the socket address.
Spectator(A)
This player spectates on a remote device identified by the socket address. They do not contribute to the game input.
Trait Implementations§
source§impl<A> Clone for PlayerType<A>
impl<A> Clone for PlayerType<A>
source§fn clone(&self) -> PlayerType<A>
fn clone(&self) -> PlayerType<A>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<A> Debug for PlayerType<A>
impl<A> Debug for PlayerType<A>
source§impl<A> Hash for PlayerType<A>
impl<A> Hash for PlayerType<A>
source§impl<A> PartialEq for PlayerType<A>
impl<A> PartialEq for PlayerType<A>
source§fn eq(&self, other: &PlayerType<A>) -> bool
fn eq(&self, other: &PlayerType<A>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<A> Copy for PlayerType<A>
impl<A> Eq for PlayerType<A>
impl<A> StructuralPartialEq for PlayerType<A>
Auto Trait Implementations§
impl<A> RefUnwindSafe for PlayerType<A>where
A: RefUnwindSafe,
impl<A> Send for PlayerType<A>where
A: Send,
impl<A> Sync for PlayerType<A>where
A: Sync,
impl<A> Unpin for PlayerType<A>where
A: Unpin,
impl<A> UnwindSafe for PlayerType<A>where
A: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more