pub struct Player<'a, 'g> { /* private fields */ }Expand description
A player node in the game tree
A player node represents a place where one of the players chooses what happens next.
Implementations§
Source§impl<'a, 'g> Player<'a, 'g>
impl<'a, 'g> Player<'a, 'g>
Sourcepub fn name(self) -> &'a EscapedStr
pub fn name(self) -> &'a EscapedStr
The name of the node
Sourcepub fn player_num(self) -> usize
pub fn player_num(self) -> usize
The player acting at this node
This will always be between 1 and the number of players.
Sourcepub fn infoset_name(self) -> &'a EscapedStr
pub fn infoset_name(self) -> &'a EscapedStr
The infoset’s label
Sourcepub fn actions(
self,
) -> impl Iterator<Item = (&'a EscapedStr, Node<'a, 'g>)> + 'g
pub fn actions( self, ) -> impl Iterator<Item = (&'a EscapedStr, Node<'a, 'g>)> + 'g
All the actions a player can take with their names and resulting nodes
Sourcepub fn action(self, label: &str) -> Option<Node<'a, 'g>>
pub fn action(self, label: &str) -> Option<Node<'a, 'g>>
The child reached by the action with the given label
label is matched against the unescaped form of each action’s label. Labels need not be
unique within an infoset, so this returns the first match.
Sourcepub fn action_at(self, index: usize) -> Option<(&'a EscapedStr, Node<'a, 'g>)>
pub fn action_at(self, index: usize) -> Option<(&'a EscapedStr, Node<'a, 'g>)>
The name and child for the action at the given index
Sourcepub fn outcome_name(self) -> Option<&'a EscapedStr>
pub fn outcome_name(self) -> Option<&'a EscapedStr>
The name of the outcome
None for the null (0) outcome.
Sourcepub fn outcome_payoffs(self) -> Option<&'g [BigRational]>
pub fn outcome_payoffs(self) -> Option<&'g [BigRational]>
Payoffs associated with the outcome
None only for the null (0) outcome.
Trait Implementations§
Auto Trait Implementations§
impl<'a, 'g> Freeze for Player<'a, 'g>
impl<'a, 'g> RefUnwindSafe for Player<'a, 'g>
impl<'a, 'g> Send for Player<'a, 'g>
impl<'a, 'g> Sync for Player<'a, 'g>
impl<'a, 'g> Unpin for Player<'a, 'g>
impl<'a, 'g> UnsafeUnpin for Player<'a, 'g>
impl<'a, 'g> UnwindSafe for Player<'a, 'g>
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