Struct StructSampler

Source
pub struct StructSampler<V> {
    pub data_type: DataType,
    pub null: Option<V>,
    pub values: Vec<ArraySampler>,
}

Fields§

§data_type: DataType§null: Option<V>§values: Vec<ArraySampler>

Trait Implementations§

Source§

impl<V> Sample for StructSampler<V>
where V: Sample<Output = bool>,

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, _: Self::Output) -> Box<dyn Iterator<Item = 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

Auto Trait Implementations§

§

impl<V> Freeze for StructSampler<V>
where V: Freeze,

§

impl<V> !RefUnwindSafe for StructSampler<V>

§

impl<V> Send for StructSampler<V>
where V: Send,

§

impl<V> Sync for StructSampler<V>
where V: Sync,

§

impl<V> Unpin for StructSampler<V>
where V: Unpin,

§

impl<V> !UnwindSafe for StructSampler<V>

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> 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. 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.