pub struct Players(HashMap<PlayerId, Player>);Expand description
Contains the players of a Lobby.
Once the game has started, no new players will be added and no existing players will be removed.
Tuple Fields§
§0: HashMap<PlayerId, Player>Implementations§
Source§impl Players
impl Players
Source§impl Players
impl Players
pub fn len(&self) -> usize
pub fn contains(&self, id: &PlayerId) -> bool
pub fn get(&self, id: &PlayerId) -> Option<&Player>
pub fn get_mut(&mut self, id: &PlayerId) -> Option<&mut Player>
pub fn iter_all(&self) -> Iter<'_, PlayerId, Player>
pub fn iter_all_mut(&mut self) -> IterMut<'_, PlayerId, Player>
pub fn players_all(&self) -> Values<'_, PlayerId, Player>
pub fn players_all_mut(&mut self) -> ValuesMut<'_, PlayerId, Player>
pub fn iter_alive(&self) -> impl Iterator<Item = (&PlayerId, &Player)>
pub fn iter_alive_mut( &mut self, ) -> impl Iterator<Item = (&PlayerId, &mut Player)>
pub fn players_alive(&self) -> impl Iterator<Item = &Player>
pub fn players_alive_mut(&mut self) -> impl Iterator<Item = &mut Player>
pub fn ids(&self) -> Keys<'_, PlayerId, Player>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Players
impl !RefUnwindSafe for Players
impl Send for Players
impl Sync for Players
impl Unpin for Players
impl !UnwindSafe for Players
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