pub struct ShuffledRng {
entries: Vec<bool>,
position: usize,
}Expand description
A shuffled finite deck containing a fixed number of successful entries.
Fields§
§entries: Vec<bool>§position: usizeImplementations§
Source§impl ShuffledRng
impl ShuffledRng
pub fn new(success_entries: u32, total_entries: u32) -> Option<Self>
Sourcepub fn from_valid_counts(success_entries: u32, total_entries: u32) -> Self
pub fn from_valid_counts(success_entries: u32, total_entries: u32) -> Self
Constructs a deck whose counts were validated by the authoring boundary.
§Panics
Panics when the deck is empty or contains more successes than entries.
pub fn reset(&mut self)
Trait Implementations§
Source§impl Clone for ShuffledRng
impl Clone for ShuffledRng
Source§fn clone(&self) -> ShuffledRng
fn clone(&self) -> ShuffledRng
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ShuffledRng
impl RefUnwindSafe for ShuffledRng
impl Send for ShuffledRng
impl Sync for ShuffledRng
impl Unpin for ShuffledRng
impl UnsafeUnpin for ShuffledRng
impl UnwindSafe for ShuffledRng
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