[−][src]Struct rust_poker::hand_indexer_s
Fields
cards_per_round: [u8; 8]
round_start: [u8; 8]
rounds: c_ulong
configurations: [c_ulong; 8]
permutations: [c_ulong; 8]
round_size: [u64; 8]
permutation_to_configuration: [*mut c_ulong; 8]
permutation_to_pi: [*mut c_ulong; 8]
configuration_to_equal: [*mut c_ulong; 8]
configuration: [*mut [c_ulong; 4]; 8]
configuration_to_suit_size: [*mut [c_ulong; 4]; 8]
configuration_to_offset: [*mut u64; 8]
Implementations
impl hand_indexer_s
[src]
Wrapper functions to interface with bindgen binding for hand_indexer_s C library
pub fn new() -> hand_indexer_s
[src]
Creates a new hand_indexer_s object
pub fn init(rounds: u32, cards_per_round: Vec<u8>) -> hand_indexer_s
[src]
Initializes a new hand_indexer
Example
use rust_poker::hand_indexer_s; let flop_indexer = hand_indexer_s::init(2, [2, 3].to_vec());
pub fn size(&self, round: u32) -> u64
[src]
Return number of indices in a round
pub fn get_index(&self, cards: &[u8]) -> u64
[src]
Gets the index for a set of cards
Example
use rust_poker::hand_indexer_s; let flop_indexer = hand_indexer_s::init(2, [2, 3].to_vec()); // first two cards are hole cards let cards = [0u8, 1, 5, 6, 7]; let index = flop_indexer.get_index(&cards);
pub fn get_hand(&self, round: u32, index: u64, cards: &mut [u8])
[src]
Gets hand for a certain index
Arguments
round
- round to get hand forcards
- cuffer to push cards into
Example
use rust_poker::hand_indexer_s; let flop_indexer = hand_indexer_s::init(2, [2, 3].to_vec()); let mut cards = [0u8; 5]; let hand_index = 400; let round = 1; flop_indexer.get_hand(round, hand_index, &mut cards);
Trait Implementations
impl Clone for hand_indexer_s
[src]
fn clone(&self) -> hand_indexer_s
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for hand_indexer_s
[src]
impl Debug for hand_indexer_s
[src]
impl Send for hand_indexer_s
[src]
impl Sync for hand_indexer_s
[src]
Auto Trait Implementations
impl RefUnwindSafe for hand_indexer_s
impl Unpin for hand_indexer_s
impl UnwindSafe for hand_indexer_s
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,