Skip to main content

SampleLen

Trait SampleLen 

Source
pub trait SampleLen: Sample<Output = Box<dyn Array>> + SetLen { }

Trait Implementations§

Source§

impl Sample for Box<dyn SampleLen>

Source§

type Output = Box<dyn Array>

Source§

fn generate(&mut self, g: &mut Random) -> Self::Output

Randomly generate the requested type.
Source§

fn shrink(&self, v: Self::Output) -> Shrunk<'_, Self::Output>

Shrink the given value into a “smaller” value. Defaults to an empty iterator (which represents that the value cannot be shrunk).
Source§

fn try_convert<T, I, F>(self, from: F, try_into: I) -> TryConvert<Self, F, I>
where Self: Sized, F: Fn(Self::Output) -> T, I: Fn(T) -> Option<Self::Output>,

Convert this sampler into a new sampler with from and try_into functions: Read more
Source§

fn zip<OS>(self, other: OS) -> Zip<Self, OS>
where Self: Sized, OS: Sample,

“Zip” two samplers together. Functionally equivalent to (self, other).
Source§

fn chain_resample<F, RS>( self, transform: F, subsamples: usize, ) -> ChainResample<Self, F>
where Self: Sized, F: Fn(Self::Output) -> RS, RS: Sample,

“Resampling” method for chaining samplers. Read more

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl SampleLen for SamplerChoice<ArrowLenSampler>

Source§

impl<S, F, I> SampleLen for TryConvert<S, F, I>
where S: Sample + SetLen, F: Fn(S::Output) -> Box<dyn Array>, I: Fn(Box<dyn Array>) -> Option<S::Output>,

Implementors§

Source§

impl SampleLen for ArrowLenSampler

Source§

impl<V, C, A, N> SampleLen for FixedSizeListWithLen<V, C, A, N>
where V: Sample<Output = Option<Bitmap>> + SetLen, C: Sample<Output = usize>, A: Sample<Output = Box<dyn Array>> + SetLen, N: Sample<Output = String>,

Source§

impl<V, C, A, N> SampleLen for ListWithLen<V, C, A, N>
where V: Sample<Output = Option<Bitmap>> + SetLen, C: Sample<Output = i32>, A: Sample<Output = Box<dyn Array>> + SetLen, N: Sample<Output = String>,