pub struct RandomNumber<T> {
pub min: T,
pub max: T,
/* private fields */
}Expand description
随机数字生成器
Fields§
§min: T最小值
max: T最大值
Implementations§
Source§impl<T> RandomNumber<T>
impl<T> RandomNumber<T>
Source§impl RandomNumber<i32>
impl RandomNumber<i32>
Sourcepub fn generate(&self) -> TestingResult<i32>
pub fn generate(&self) -> TestingResult<i32>
生成随机 i32
Source§impl RandomNumber<i64>
impl RandomNumber<i64>
Sourcepub fn generate(&self) -> TestingResult<i64>
pub fn generate(&self) -> TestingResult<i64>
生成随机 i64
Source§impl RandomNumber<u32>
impl RandomNumber<u32>
Sourcepub fn generate(&self) -> TestingResult<u32>
pub fn generate(&self) -> TestingResult<u32>
生成随机 u32
Source§impl RandomNumber<u64>
impl RandomNumber<u64>
Sourcepub fn generate(&self) -> TestingResult<u64>
pub fn generate(&self) -> TestingResult<u64>
生成随机 u64
Source§impl RandomNumber<f64>
impl RandomNumber<f64>
Sourcepub fn generate(&self) -> TestingResult<f64>
pub fn generate(&self) -> TestingResult<f64>
生成随机 f64
Trait Implementations§
Source§impl<T: Clone> Clone for RandomNumber<T>
impl<T: Clone> Clone for RandomNumber<T>
Source§fn clone(&self) -> RandomNumber<T>
fn clone(&self) -> RandomNumber<T>
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<T> Freeze for RandomNumber<T>where
T: Freeze,
impl<T> RefUnwindSafe for RandomNumber<T>where
T: RefUnwindSafe,
impl<T> Send for RandomNumber<T>where
T: Send,
impl<T> Sync for RandomNumber<T>where
T: Sync,
impl<T> Unpin for RandomNumber<T>where
T: Unpin,
impl<T> UnsafeUnpin for RandomNumber<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for RandomNumber<T>where
T: UnwindSafe,
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