Struct randomize::BoundedRandU16
source · pub struct BoundedRandU16 { /* private fields */ }
Expand description
Allows sampling a u16
number in 0 .. N
.
The primary advantage of this type over BoundedRandU32 is that this type samples using only 32-bit multiplications rather than 64-bit multiplications, so on a 32-bit CPU this will perform much faster.
Implementations§
source§impl BoundedRandU16
impl BoundedRandU16
pub const _4: Self = _
pub const _6: Self = _
pub const _8: Self = _
pub const _10: Self = _
pub const _12: Self = _
pub const _20: Self = _
Trait Implementations§
source§impl Clone for BoundedRandU16
impl Clone for BoundedRandU16
source§fn clone(&self) -> BoundedRandU16
fn clone(&self) -> BoundedRandU16
Returns a copy 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 moresource§impl Debug for BoundedRandU16
impl Debug for BoundedRandU16
source§impl Hash for BoundedRandU16
impl Hash for BoundedRandU16
source§impl PartialEq<BoundedRandU16> for BoundedRandU16
impl PartialEq<BoundedRandU16> for BoundedRandU16
source§fn eq(&self, other: &BoundedRandU16) -> bool
fn eq(&self, other: &BoundedRandU16) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for BoundedRandU16
impl Eq for BoundedRandU16
impl StructuralEq for BoundedRandU16
impl StructuralPartialEq for BoundedRandU16
Auto Trait Implementations§
impl RefUnwindSafe for BoundedRandU16
impl Send for BoundedRandU16
impl Sync for BoundedRandU16
impl Unpin for BoundedRandU16
impl UnwindSafe for BoundedRandU16
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