Skip to main content

Array

Struct Array 

Source
pub struct Array<G: ?Sized, const N: usize>(/* private fields */);

Trait Implementations§

Source§

impl<G: Clone + ?Sized, const N: usize> Clone for Array<G, N>

Source§

fn clone(&self) -> Array<G, N>

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<C: Constant, const N: usize> Constant for Array<C, N>

Source§

const VALUE: Self

Source§

impl<G: Debug + ?Sized, const N: usize> Debug for Array<G, N>

Source§

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

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

impl<G: Generate + ?Sized, const N: usize> Generate for Array<G, N>

Source§

const CARDINALITY: Option<u128>

The static cardinality of the generated values. Read more
Source§

type Item = [<G as Generate>::Item; N]

Source§

type Shrink = Shrinker<[<G as Generate>::Shrink; N]>

Source§

fn generate(&self, state: &mut State) -> Self::Shrink

Generates a random value and its associated Shrink instance. Read more
Source§

fn cardinality(&self) -> Option<u128>

Returns the dynamic cardinality of the generated values. Read more
Source§

fn boxed(self) -> Boxed<Self::Item>
where Self: Sized + 'static,

Wraps self in a boxed Generate to erase its concrete type. Read more
Source§

fn map<T, F: Fn(Self::Item) -> T + Clone>(self, map: F) -> Map<Self, F>
where Self: Sized,

Creates a new generator that maps the output of self. Read more
Source§

fn filter<F: Fn(&Self::Item) -> bool + Clone>( self, filter: F, ) -> Filter<Self, F>
where Self: Sized,

Creates a new generator that discards values that don’t match a predicate. Read more
Source§

fn filter_map<T, F: Fn(Self::Item) -> Option<T> + Clone>( self, filter: F, ) -> FilterMap<Self, F>
where Self: Sized,

Creates a new generator that both filters and maps values simultaneously. Read more
Source§

fn flat_map<G: Generate, F: Fn(Self::Item) -> G + Clone>( self, map: F, ) -> Flatten<Map<Self, F>>
where Self: Sized,

Creates a new generator by applying a function to the output of self, and then flattening the result. Read more
Source§

fn flatten(self) -> Flatten<Self>
where Self: Sized, Self::Item: Generate,

Flattens a generator of generators. Read more
Source§

fn any(self) -> Any<Self>
where Self: Sized,

Creates a new generator that randomly chooses one of a set of generators. Read more
Source§

fn array<const N: usize>(self) -> Array<Self, N>
where Self: Sized,

Creates a generator that produces a fixed-size array. Read more
Source§

fn collect<F: FromIterator<Self::Item>>( self, ) -> Collect<Self, Range<Usize<0>, Usize<COLLECTS>>, F>
where Self: Sized,

Creates a generator that produces a collection with up to a default size. Read more
Source§

fn collect_with<C: Count, F: FromIterator<Self::Item>>( self, count: C, ) -> Collect<Self, C, F>
where Self: Sized,

Creates a generator that produces a collection of a specified range of sizes (as returned by C::count()).
Source§

fn size<S: Into<Sizes>, F: Fn(Sizes) -> S>(self, map: F) -> Size<Self, F>
where Self: Sized,

Creates a generator that modifies the size parameter for subsequent generation. Read more
Source§

fn dampen(self) -> Dampen<Self>
where Self: Sized,

Dampens the size of generation, typically for recursive structures. Read more
Source§

fn dampen_with( self, pressure: f64, deepest: usize, limit: usize, ) -> Dampen<Self>
where Self: Sized,

Dampens the size with configurable parameters. Read more
Source§

fn keep(self) -> Keep<Self>
where Self: Sized,

Creates a generator whose values are not shrunk. Read more
Source§

fn unify<T>(self) -> Unify<Self, T>
where Self: Sized,

Unifies a generator of orn::Or type into a single type when the conversion is possible. Read more
Source§

fn convert<T: From<Self::Item>>(self) -> Convert<Self, T>
where Self: Sized,

Creates a new generator that converts the output of self using From. Read more

Auto Trait Implementations§

§

impl<G, const N: usize> Freeze for Array<G, N>
where G: Freeze + ?Sized,

§

impl<G, const N: usize> RefUnwindSafe for Array<G, N>
where G: RefUnwindSafe + ?Sized,

§

impl<G, const N: usize> Send for Array<G, N>
where G: Send + ?Sized,

§

impl<G, const N: usize> Sync for Array<G, N>
where G: Sync + ?Sized,

§

impl<G, const N: usize> Unpin for Array<G, N>
where G: Unpin + ?Sized,

§

impl<G, const N: usize> UnsafeUnpin for Array<G, N>
where G: UnsafeUnpin + ?Sized,

§

impl<G, const N: usize> UnwindSafe for Array<G, N>
where G: UnwindSafe + ?Sized,

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<G> Check for G
where G: Generate + ?Sized,

Source§

fn checker(self) -> Checker<Self, Run>
where Self: Sized,

Creates a Checker for this generator. Read more
Source§

fn checks<P: Prove, C: FnMut(Self::Item) -> P>( self, check: C, ) -> Iterator<Self, P, C>
where Self: Sized,

Creates an iterator that runs the property test. Read more
Source§

fn check<P: Prove, C: FnMut(Self::Item) -> P>( &self, check: C, ) -> Option<Fail<Self::Item, P::Error>>

Runs the property test and returns the final failure, if any. 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<G> Sample for G
where G: Generate + ?Sized,

Source§

fn sampler(self) -> Sampler<Self>
where Self: Sized,

Creates a Sampler for this generator. Read more
Source§

fn samples(self, count: usize) -> Samples<Self>
where Self: Sized,

Creates an iterator that generates count random values. Read more
Source§

fn sample(&self, size: f64) -> Self::Item

Generates a single random value of a specific size. 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.