IntGenerator

Struct IntGenerator 

Source
pub struct IntGenerator<T> { /* private fields */ }
Expand description

Generator for integer types with optional range constraints

Implementations§

Source§

impl<T> IntGenerator<T>
where T: Copy + PartialOrd,

Source

pub fn new(min: T, max: T) -> Self

Create a new integer generator with the full range for the type

Source§

impl IntGenerator<i8>

Source

pub fn full_range() -> Self

Create a generator for the full range of the type

Source§

impl IntGenerator<i16>

Source

pub fn full_range() -> Self

Create a generator for the full range of the type

Source§

impl IntGenerator<i32>

Source

pub fn full_range() -> Self

Create a generator for the full range of the type

Source§

impl IntGenerator<i64>

Source

pub fn full_range() -> Self

Create a generator for the full range of the type

Source§

impl IntGenerator<i128>

Source

pub fn full_range() -> Self

Create a generator for the full range of the type

Source§

impl IntGenerator<isize>

Source

pub fn full_range() -> Self

Create a generator for the full range of the type

Source§

impl IntGenerator<u8>

Source

pub fn full_range() -> Self

Create a generator for the full range of the type

Source§

impl IntGenerator<u16>

Source

pub fn full_range() -> Self

Create a generator for the full range of the type

Source§

impl IntGenerator<u32>

Source

pub fn full_range() -> Self

Create a generator for the full range of the type

Source§

impl IntGenerator<u64>

Source

pub fn full_range() -> Self

Create a generator for the full range of the type

Source§

impl IntGenerator<u128>

Source

pub fn full_range() -> Self

Create a generator for the full range of the type

Source§

impl IntGenerator<usize>

Source

pub fn full_range() -> Self

Create a generator for the full range of the type

Trait Implementations§

Source§

impl<T: Clone> Clone for IntGenerator<T>

Source§

fn clone(&self) -> IntGenerator<T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug> Debug for IntGenerator<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Generator<i128> for IntGenerator<i128>

Source§

fn generate(&self, rng: &mut dyn RngCore, _config: &GeneratorConfig) -> i128

Generate a random value of type T using the provided RNG and configuration
Source§

fn shrink(&self, value: &i128) -> Box<dyn Iterator<Item = i128>>

Create an iterator of shrunk values from the given value
Source§

impl Generator<i16> for IntGenerator<i16>

Source§

fn generate(&self, rng: &mut dyn RngCore, _config: &GeneratorConfig) -> i16

Generate a random value of type T using the provided RNG and configuration
Source§

fn shrink(&self, value: &i16) -> Box<dyn Iterator<Item = i16>>

Create an iterator of shrunk values from the given value
Source§

impl Generator<i32> for IntGenerator<i32>

Source§

fn generate(&self, rng: &mut dyn RngCore, _config: &GeneratorConfig) -> i32

Generate a random value of type T using the provided RNG and configuration
Source§

fn shrink(&self, value: &i32) -> Box<dyn Iterator<Item = i32>>

Create an iterator of shrunk values from the given value
Source§

impl Generator<i64> for IntGenerator<i64>

Source§

fn generate(&self, rng: &mut dyn RngCore, _config: &GeneratorConfig) -> i64

Generate a random value of type T using the provided RNG and configuration
Source§

fn shrink(&self, value: &i64) -> Box<dyn Iterator<Item = i64>>

Create an iterator of shrunk values from the given value
Source§

impl Generator<i8> for IntGenerator<i8>

Source§

fn generate(&self, rng: &mut dyn RngCore, _config: &GeneratorConfig) -> i8

Generate a random value of type T using the provided RNG and configuration
Source§

fn shrink(&self, value: &i8) -> Box<dyn Iterator<Item = i8>>

Create an iterator of shrunk values from the given value
Source§

impl Generator<isize> for IntGenerator<isize>

Source§

fn generate(&self, rng: &mut dyn RngCore, _config: &GeneratorConfig) -> isize

Generate a random value of type T using the provided RNG and configuration
Source§

fn shrink(&self, value: &isize) -> Box<dyn Iterator<Item = isize>>

Create an iterator of shrunk values from the given value
Source§

impl Generator<u128> for IntGenerator<u128>

Source§

fn generate(&self, rng: &mut dyn RngCore, _config: &GeneratorConfig) -> u128

Generate a random value of type T using the provided RNG and configuration
Source§

fn shrink(&self, value: &u128) -> Box<dyn Iterator<Item = u128>>

Create an iterator of shrunk values from the given value
Source§

impl Generator<u16> for IntGenerator<u16>

Source§

fn generate(&self, rng: &mut dyn RngCore, _config: &GeneratorConfig) -> u16

Generate a random value of type T using the provided RNG and configuration
Source§

fn shrink(&self, value: &u16) -> Box<dyn Iterator<Item = u16>>

Create an iterator of shrunk values from the given value
Source§

impl Generator<u32> for IntGenerator<u32>

Source§

fn generate(&self, rng: &mut dyn RngCore, _config: &GeneratorConfig) -> u32

Generate a random value of type T using the provided RNG and configuration
Source§

fn shrink(&self, value: &u32) -> Box<dyn Iterator<Item = u32>>

Create an iterator of shrunk values from the given value
Source§

impl Generator<u64> for IntGenerator<u64>

Source§

fn generate(&self, rng: &mut dyn RngCore, _config: &GeneratorConfig) -> u64

Generate a random value of type T using the provided RNG and configuration
Source§

fn shrink(&self, value: &u64) -> Box<dyn Iterator<Item = u64>>

Create an iterator of shrunk values from the given value
Source§

impl Generator<u8> for IntGenerator<u8>

Source§

fn generate(&self, rng: &mut dyn RngCore, _config: &GeneratorConfig) -> u8

Generate a random value of type T using the provided RNG and configuration
Source§

fn shrink(&self, value: &u8) -> Box<dyn Iterator<Item = u8>>

Create an iterator of shrunk values from the given value
Source§

impl Generator<usize> for IntGenerator<usize>

Source§

fn generate(&self, rng: &mut dyn RngCore, _config: &GeneratorConfig) -> usize

Generate a random value of type T using the provided RNG and configuration
Source§

fn shrink(&self, value: &usize) -> Box<dyn Iterator<Item = usize>>

Create an iterator of shrunk values from the given value

Auto Trait Implementations§

§

impl<T> Freeze for IntGenerator<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for IntGenerator<T>
where T: RefUnwindSafe,

§

impl<T> Send for IntGenerator<T>
where T: Send,

§

impl<T> Sync for IntGenerator<T>
where T: Sync,

§

impl<T> Unpin for IntGenerator<T>
where T: Unpin,

§

impl<T> UnwindSafe for IntGenerator<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V