Struct MaybeErr

#[must_use = "strategies do nothing unless used"]
pub struct MaybeErr<T, E>(/* private field */)
where
    T: Strategy,
    E: Strategy,;

Strategy which generates Results using Ok and Err values from two delegate strategies.

Shrinks to Ok.

Trait Implementations

impl<T, E> Clone for MaybeErr<T, E> where T: Strategy + Clone, E: Strategy + Clone,

fn clone(&self) -> MaybeErr<T, E>

impl<T, E> Strategy for MaybeErr<T, E> where T: Strategy, E: Strategy,

type Tree = MaybeErrValueTree<T, E>;
type Value = Result<<T as Strategy>::Value, <E as Strategy>::Value>;
fn new_tree(&self, runner: &mut TestRunner) -> NewTree<Self>

impl<T: Strategy + Debug, E: Strategy + Debug> Debug for MaybeErr<T, E>

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

Auto Trait Implementations

impl<T, E> Freeze for MaybeErr<T, E> where TupleUnion<((u32, Arc<Map<T, WrapOk<<T as Strategy>::Value, <E as Strategy>::Value>>>), (u32, Arc<Map<E, WrapErr<<T as Strategy>::Value, <E as Strategy>::Value>>>))>: Freeze,

impl<T, E> RefUnwindSafe for MaybeErr<T, E> where TupleUnion<((u32, Arc<Map<T, WrapOk<<T as Strategy>::Value, <E as Strategy>::Value>>>), (u32, Arc<Map<E, WrapErr<<T as Strategy>::Value, <E as Strategy>::Value>>>))>: RefUnwindSafe,

impl<T, E> Send for MaybeErr<T, E> where TupleUnion<((u32, Arc<Map<T, WrapOk<<T as Strategy>::Value, <E as Strategy>::Value>>>), (u32, Arc<Map<E, WrapErr<<T as Strategy>::Value, <E as Strategy>::Value>>>))>: Send,

impl<T, E> Sync for MaybeErr<T, E> where TupleUnion<((u32, Arc<Map<T, WrapOk<<T as Strategy>::Value, <E as Strategy>::Value>>>), (u32, Arc<Map<E, WrapErr<<T as Strategy>::Value, <E as Strategy>::Value>>>))>: Sync,

impl<T, E> Unpin for MaybeErr<T, E> where TupleUnion<((u32, Arc<Map<T, WrapOk<<T as Strategy>::Value, <E as Strategy>::Value>>>), (u32, Arc<Map<E, WrapErr<<T as Strategy>::Value, <E as Strategy>::Value>>>))>: Unpin,

impl<T, E> UnsafeUnpin for MaybeErr<T, E> where TupleUnion<((u32, Arc<Map<T, WrapOk<<T as Strategy>::Value, <E as Strategy>::Value>>>), (u32, Arc<Map<E, WrapErr<<T as Strategy>::Value, <E as Strategy>::Value>>>))>: UnsafeUnpin,

impl<T, E> UnwindSafe for MaybeErr<T, E> where TupleUnion<((u32, Arc<Map<T, WrapOk<<T as Strategy>::Value, <E as Strategy>::Value>>>), (u32, Arc<Map<E, WrapErr<<T as Strategy>::Value, <E as Strategy>::Value>>>))>: UnwindSafe,

Blanket Implementations

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for MaybeErr<T, E> where ST: ?Sized, DT: ?Sized,

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for MaybeErr<T, E> where ST: ?Sized, DT: ?Sized,

impl<T> Any for MaybeErr<T, E> where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for MaybeErr<T, E> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for MaybeErr<T, E> where T: ?Sized,

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

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

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

impl<T> From<T> for MaybeErr<T, E>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Read<Exclusive, BecauseExclusive> for MaybeErr<T, E> where T: ?Sized,

impl<T> ToOwned for MaybeErr<T, E> where T: Clone,

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

impl<T, U> Into<U> for MaybeErr<T, E> 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 MaybeErr<T, E> where U: Into<T>,

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

impl<T, U> TryInto<U> for MaybeErr<T, E> 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 MaybeErr<T, E> where V: MultiLane<T>,

fn vzip(self) -> V