pub struct Array<G: ?Sized, const N: usize>(/* private fields */);Trait Implementations§
Source§impl<G: Generate + ?Sized, const N: usize> Generate for Array<G, N>
impl<G: Generate + ?Sized, const N: usize> Generate for Array<G, N>
type Item = [<G as Generate>::Item; N]
type Shrink = Shrinker<[<G as Generate>::Shrink; N]>
Source§fn cardinality(&self) -> Option<u128>
fn cardinality(&self) -> Option<u128>
Returns the dynamic cardinality of the generated values. Read more
Source§fn map<T, F: Fn(Self::Item) -> T + Clone>(self, map: F) -> Map<Self, F>where
Self: Sized,
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 moreSource§fn filter<F: Fn(&Self::Item) -> bool + Clone>(
self,
filter: F,
) -> Filter<Self, F>where
Self: Sized,
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,
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,
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 moreSource§fn any(self) -> Any<Self>where
Self: Sized,
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,
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,
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,
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,
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 moreSource§fn dampen(self) -> Dampen<Self>where
Self: Sized,
fn dampen(self) -> Dampen<Self>where
Self: Sized,
Dampens the
size of generation, typically for recursive structures. Read moreSource§fn dampen_with(
self,
pressure: f64,
deepest: usize,
limit: usize,
) -> Dampen<Self>where
Self: Sized,
fn dampen_with(
self,
pressure: f64,
deepest: usize,
limit: usize,
) -> Dampen<Self>where
Self: Sized,
Dampens the
size with configurable parameters. Read moreSource§fn keep(self) -> Keep<Self>where
Self: Sized,
fn keep(self) -> Keep<Self>where
Self: Sized,
Creates a generator whose values are not shrunk. Read more
Auto Trait Implementations§
impl<G, const N: usize> Freeze for Array<G, N>
impl<G, const N: usize> RefUnwindSafe for Array<G, N>where
G: RefUnwindSafe + ?Sized,
impl<G, const N: usize> Send for Array<G, N>
impl<G, const N: usize> Sync for Array<G, N>
impl<G, const N: usize> Unpin for Array<G, N>
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> 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