[][src]Struct weasel::player::RightsHandleMut

pub struct RightsHandleMut<'a, R, I> where
    R: BattleRules,
    I: Iterator<Item = &'a TeamId<R>>, 
{ /* fields omitted */ }

A structure to access and manipulate player's rights. Rights are used to control which players can act on behalf of what teams.

Implementations

impl<'a, R, I> RightsHandleMut<'a, R, I> where
    R: BattleRules,
    I: Iterator<Item = &'a TeamId<R>>, 
[src]

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

impl<'a, R, I> Send for RightsHandleMut<'a, R, I> where
    I: Send,
    <<R as BattleRules>::TR as TeamRules<R>>::Id: Send

impl<'a, R, I> Sync for RightsHandleMut<'a, R, I> where
    I: Sync,
    <<R as BattleRules>::TR as TeamRules<R>>::Id: Sync

impl<'a, R, I> Unpin for RightsHandleMut<'a, R, I> where
    I: Unpin

impl<'a, R, I> !UnwindSafe for RightsHandleMut<'a, R, I>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,