pub struct Card64(/* private fields */);Expand description
Bitset representation of card collections.
A 64-bit bitset for efficient card set operations. Each bit represents a specific card, enabling fast membership tests and set operations.
§Memory Layout
[63, 48]: xxxAKQJT 98765432 // Club
[47, 32]: xxxAKQJT 98765432 // Diamond
[31, 16]: xxxAKQJT 98765432 // Heart
[15, 0]: xxxAKQJT 98765432 // Spade, x: unusedImplementations§
Source§impl Card64
impl Card64
pub const fn all<const SD: bool>() -> Self
Sourcepub fn contains(self, other: Self) -> bool
pub fn contains(self, other: Self) -> bool
Returns true if this set contains all cards in other.
Sourcepub const fn contains_card(self, card: Card) -> bool
pub const fn contains_card(self, card: Card) -> bool
Returns true if this set contains the specified card.
Sourcepub const fn count_by_rank(self, rank: Rank) -> CardCount
pub const fn count_by_rank(self, rank: Rank) -> CardCount
Returns the number of cards with the specified rank.
Sourcepub const fn count_by_suit(self, suit: Suit) -> CardCount
pub const fn count_by_suit(self, suit: Suit) -> CardCount
Returns the number of cards with the specified suit.
Sourcepub const fn from_ranks(rs: Rank16) -> Self
pub const fn from_ranks(rs: Rank16) -> Self
Creates a card set containing all specified ranks in all suits.
Trait Implementations§
Source§impl BitAndAssign for Card64
impl BitAndAssign for Card64
Source§fn bitand_assign(&mut self, rhs: Card64)
fn bitand_assign(&mut self, rhs: Card64)
Performs the
&= operation. Read moreSource§impl BitOrAssign<Card> for Card64
impl BitOrAssign<Card> for Card64
Source§fn bitor_assign(&mut self, rhs: Card)
fn bitor_assign(&mut self, rhs: Card)
Performs the
|= operation. Read moreSource§impl BitOrAssign<HandN<3>> for Card64
impl BitOrAssign<HandN<3>> for Card64
Source§fn bitor_assign(&mut self, rhs: Flop)
fn bitor_assign(&mut self, rhs: Flop)
Performs the
|= operation. Read moreSource§impl BitOrAssign for Card64
impl BitOrAssign for Card64
Source§fn bitor_assign(&mut self, rhs: Card64)
fn bitor_assign(&mut self, rhs: Card64)
Performs the
|= operation. Read moreSource§impl FromIterator<Card> for Card64
impl FromIterator<Card> for Card64
impl Copy for Card64
impl Eq for Card64
impl StructuralPartialEq for Card64
Auto Trait Implementations§
impl Freeze for Card64
impl RefUnwindSafe for Card64
impl Send for Card64
impl Sync for Card64
impl Unpin for Card64
impl UnwindSafe for Card64
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