pub struct CardSet(/* private fields */);Expand description
A set of cards, packed as a 52-bit mask (bit card.index() per card).
use native_solver::{Card, CardSet};
let board: Vec<Card> = ["Ks", "Th", "7s"].iter().map(|s| s.parse()).collect::<Result<_, _>>()?;
let dead = CardSet::from_cards(&board);
assert!(dead.contains("Ks".parse()?));
assert_eq!(dead.len(), 3);Implementations§
Trait Implementations§
impl Copy for CardSet
impl Eq for CardSet
Source§impl Extend<Card> for CardSet
impl Extend<Card> for CardSet
Source§fn extend<I: IntoIterator<Item = Card>>(&mut self, cards: I)
fn extend<I: IntoIterator<Item = Card>>(&mut self, cards: I)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: T)
fn extend_one(&mut self, item: T)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl FromIterator<Card> for CardSet
impl FromIterator<Card> for CardSet
impl StructuralPartialEq for CardSet
Auto Trait Implementations§
impl Forget for CardSet
impl Freeze for CardSet
impl Move for CardSet
impl RefUnwindSafe for CardSet
impl Send for CardSet
impl Sync for CardSet
impl Unpin for CardSet
impl UnsafeUnpin for CardSet
impl UnwindSafe for CardSet
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more