checkito::map

Struct Map

source
pub struct Map<T: ?Sized, F>(/* private fields */);

Trait Implementations§

source§

impl<T: Clone + ?Sized, F: Clone> Clone for Map<T, F>

source§

fn clone(&self) -> Map<T, F>

Returns a copy 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 + ?Sized, F: Debug> Debug for Map<T, F>

source§

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

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

impl<G: Generate + ?Sized, T, F: Fn(G::Item) -> T + Clone> Generate for Map<G, F>

source§

type Item = T

source§

type Shrink = Map<<G as Generate>::Shrink, F>

source§

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

Primary method of this trait. It generates a Shrink instance that will be able to produce values of type Generate::Item and shrink itself.
source§

fn constant(&self) -> bool

Returns true if the generator will always produce the same item. This is used in some optimizations to prevent redundant generations.
source§

impl<S: Shrink, T, F: Fn(S::Item) -> T + Clone> Shrink for Map<S, F>

source§

type Item = T

source§

fn item(&self) -> Self::Item

source§

fn shrink(&mut self) -> Option<Self>

Auto Trait Implementations§

§

impl<T, F> Freeze for Map<T, F>
where F: Freeze, T: Freeze + ?Sized,

§

impl<T, F> RefUnwindSafe for Map<T, F>

§

impl<T, F> Send for Map<T, F>
where F: Send, T: Send + ?Sized,

§

impl<T, F> Sync for Map<T, F>
where F: Sync, T: Sync + ?Sized,

§

impl<T, F> Unpin for Map<T, F>
where F: Unpin, T: Unpin + ?Sized,

§

impl<T, F> UnwindSafe for Map<T, F>
where F: UnwindSafe, T: 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>

source§

fn checks<P: Prove, F: FnMut(Self::Item) -> P>( &self, check: F, ) -> Checks<'_, Self, P::Error, F>

source§

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

source§

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

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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>

Provides a Sampler that allows to configure sampling settings and generate samples.
source§

fn samples(&self, count: usize) -> Samples<'_, Self>

Generates count random values the are progressively larger in size. For additional sampling settings, see Sample::sampler.
source§

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

Generates a random value of size (0.0..=1.0). For additional sampling settings, see Sample::sampler.
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.