[−][src]Struct weasel::player::RightsHandleMut
A structure to access and manipulate player's rights. Rights are used to control which players can act on behalf of what teams.
Methods
impl<'a, R, I> RightsHandleMut<'a, R, I> where
R: BattleRules,
I: Iterator<Item = &'a TeamId<R>>,
[src]
R: BattleRules,
I: Iterator<Item = &'a TeamId<R>>,
pub fn add(&mut self, player: PlayerId, team: &TeamId<R>) -> WeaselResult<(), R>
[src]
Add rights to control the team with the given id to player
. The team must exist.
pub fn remove(&mut self, player: PlayerId, team: &TeamId<R>)
[src]
Remove player rights to control the team with the given id.
pub fn clear(&mut self)
[src]
Removes all stored rights.
pub fn remove_team(&mut self, team: &TeamId<R>)
[src]
Remove all occurrences of a team from all players' rights.
pub fn remove_player(&mut self, player: PlayerId)
[src]
Remove all rights of a player.
pub fn get(&self) -> impl Iterator<Item = (PlayerId, &[TeamId<R>])>
[src]
Returns an iterator over all players' rights.
pub fn check(&self, player: PlayerId, team: &TeamId<R>) -> bool
[src]
Returns true
if player
has rights to control team
.
Auto Trait Implementations
impl<'a, R, I> RefUnwindSafe for RightsHandleMut<'a, R, I> where
I: RefUnwindSafe,
<<R as BattleRules>::TR as TeamRules<R>>::Id: RefUnwindSafe,
<R as BattleRules>::TR: TeamRules<R>,
I: RefUnwindSafe,
<<R as BattleRules>::TR as TeamRules<R>>::Id: RefUnwindSafe,
<R as BattleRules>::TR: TeamRules<R>,
impl<'a, R, I> Send for RightsHandleMut<'a, R, I> where
I: Send,
<<R as BattleRules>::TR as TeamRules<R>>::Id: Send,
<R as BattleRules>::TR: TeamRules<R>,
I: Send,
<<R as BattleRules>::TR as TeamRules<R>>::Id: Send,
<R as BattleRules>::TR: TeamRules<R>,
impl<'a, R, I> Sync for RightsHandleMut<'a, R, I> where
I: Sync,
<<R as BattleRules>::TR as TeamRules<R>>::Id: Sync,
<R as BattleRules>::TR: TeamRules<R>,
I: Sync,
<<R as BattleRules>::TR as TeamRules<R>>::Id: Sync,
<R as BattleRules>::TR: TeamRules<R>,
impl<'a, R, I> Unpin for RightsHandleMut<'a, R, I> where
I: Unpin,
I: Unpin,
impl<'a, R, I> !UnwindSafe for RightsHandleMut<'a, R, I>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,