Struct Map

#[must_use = "strategies do nothing unless used"]
pub struct Map<S, F> { /* private fields */ }

Static version of strategy::Map.

Implementations

impl<S, F> Map<S, F>

fn new(source: S, fun: F) -> Self

Adapt strategy source by applying fun to values it produces.

Trait Implementations

impl<S: Clone, F: Clone> Clone for Map<S, F>

fn clone(&self) -> Self

impl<S: Debug, F> Debug for Map<S, F>

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

impl<S: Strategy, F: Clone + MapFn<S::Value>> Strategy for Map<S, F>

type Tree = Map<<S as Strategy>::Tree, F>;
type Value = <F as MapFn<<S as Strategy>::Value>>::Output;
fn new_tree(&self, runner: &mut TestRunner) -> NewTree<Self>

impl<S: ValueTree, F: MapFn<S::Value>> ValueTree for Map<S, F>

type Value = <F as MapFn<<S as ValueTree>::Value>>::Output;
fn current(&self) -> F::Output
fn simplify(&mut self) -> bool
fn complicate(&mut self) -> bool

Auto Trait Implementations

impl<S, F> Freeze for Map<S, F> where S: Freeze, F: Freeze,

impl<S, F> RefUnwindSafe for Map<S, F> where S: RefUnwindSafe, F: RefUnwindSafe,

impl<S, F> Send for Map<S, F> where S: Send, F: Send,

impl<S, F> Sync for Map<S, F> where S: Sync, F: Sync,

impl<S, F> Unpin for Map<S, F> where S: Unpin, F: Unpin,

impl<S, F> UnsafeUnpin for Map<S, F> where S: UnsafeUnpin, F: UnsafeUnpin,

impl<S, F> UnwindSafe for Map<S, F> where S: UnwindSafe, F: UnwindSafe,

Blanket Implementations

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for Map<S, F> where ST: ?Sized, DT: ?Sized,

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for Map<S, F> where ST: ?Sized, DT: ?Sized,

impl<T> Any for Map<S, F> where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for Map<S, F> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for Map<S, F> where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> CloneToUninit for Map<S, F> where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for Map<S, F>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Read<Exclusive, BecauseExclusive> for Map<S, F> where T: ?Sized,

impl<T> ToOwned for Map<S, F> where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

impl<T, U> Into<U> for Map<S, F> where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for Map<S, F> where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for Map<S, F> where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

impl<V, T> VZip<V> for Map<S, F> where V: MultiLane<T>,

fn vzip(self) -> V