Skip to main content

HasHands

Trait HasHands 

Source
pub trait HasHands {
    // Required methods
    fn hands(&self) -> &Hands;
    fn hands_mut(&mut self) -> &mut Hands;

    // Provided methods
    fn hand(&self, player: Player) -> &Hand { ... }
    fn hand_mut(&mut self, player: Player) -> &mut Hand { ... }
}
Expand description

Trait for game states that have player hands.

Required Methods§

Source

fn hands(&self) -> &Hands

Immutable access to all hands.

Source

fn hands_mut(&mut self) -> &mut Hands

Mutable access to all hands.

Provided Methods§

Source

fn hand(&self, player: Player) -> &Hand

Returns an immutable reference to the given player’s hand.

Source

fn hand_mut(&mut self, player: Player) -> &mut Hand

Returns a mutable reference to the given player’s hand.

Implementors§