pub struct Board {
pub flop: Option<Flop>,
pub turn: Option<Card>,
pub river: Option<Card>,
}Expand description
Board representation for poker games.
Represents community cards (flop, turn, river) with a macro for convenient creation.
Fields§
§flop: Option<Flop>§turn: Option<Card>§river: Option<Card>Implementations§
Source§impl Board
impl Board
Sourcepub fn from_slice(cards: &[Card]) -> Self
pub fn from_slice(cards: &[Card]) -> Self
Creates a board from a slice of cards.
Expects cards in order: flop (3 cards), turn, river. Cards beyond the first 5 are ignored.
Sourcepub fn iter(&self) -> impl Iterator<Item = Card> + '_
pub fn iter(&self) -> impl Iterator<Item = Card> + '_
Returns an iterator over all cards on the board.
Sourcepub const fn contains_card(&self, card: Card) -> bool
pub const fn contains_card(&self, card: Card) -> bool
Returns true if the board contains the specified card.
Source§impl Board
impl Board
Sourcepub fn new_iso_with_mapping(cards: &[Card], mapping: &mut SuitMapping) -> Self
pub fn new_iso_with_mapping(cards: &[Card], mapping: &mut SuitMapping) -> Self
Creates a suit-isomorphic board using the provided suit mapping.
Sourcepub fn new_iso(cards: &[Card]) -> (Self, SuitMapping)
pub fn new_iso(cards: &[Card]) -> (Self, SuitMapping)
Creates a suit-isomorphic board and returns the suit mapping used.
Trait Implementations§
impl Copy for Board
impl Eq for Board
impl StructuralPartialEq for Board
Auto Trait Implementations§
impl Freeze for Board
impl RefUnwindSafe for Board
impl Send for Board
impl Sync for Board
impl Unpin for Board
impl UnwindSafe for Board
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