[−][src]Struct hidden::dispenser::Dispenser
A struct that holds a hidden variable, dispenses Hand
s with a lock on a
state, and shuffles afterward.
Implementations
impl Dispenser
[src]
pub fn new(len: usize) -> Self
[src]
Creates a new Dispenser
, initializing it with choices for a slice of a given
len
.
pub fn len(&self) -> usize
[src]
Returns the effective len
argument given to new
for this object.
pub fn make_hand<'h, T>(&mut self, deck: &'h [T]) -> Option<Hand<'h, T>>
[src]
Creates a Hand
from deck
and an internal variable, this shuffles the variable afterwards.
This makes first sure that all possible choices are possible for deck
, it does this by
checking the length of deck
, and effectively comparing it to the len
given when the
Dispenser
was created.
This function returns None
when it's possible that elements in deck
cannot be chosen, or
there are more possible choices than that deck
has. (deck.len() != len
)
This function returns Some
when checks pass, and all choices has a corresponding element
in deck
.
pub fn make_hand_unchecked<'h, T>(&mut self, deck: &'h [T]) -> Hand<'h, T>
[src]
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Dispenser
impl !Send for Dispenser
impl !Sync for Dispenser
impl Unpin for Dispenser
impl UnwindSafe for Dispenser
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, 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>,