Struct BoxedStrategy

#[must_use = "strategies do nothing unless used"]
pub struct BoxedStrategy<T>(/* private field */);

A boxed Strategy trait object as produced by Strategy::boxed().

Strategies of this type afford cheap shallow cloning via reference counting by using an Arc internally.

Trait Implementations

impl<T> Clone for BoxedStrategy<T>

fn clone(&self) -> Self

impl<T: Debug> Debug for BoxedStrategy<T>

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

impl<T: Debug> Strategy for BoxedStrategy<T>

type Tree = Box<dyn ValueTree<Value = T>>;
type Value = T;
fn new_tree(&self, runner: &mut TestRunner) -> NewTree<Self>
fn boxed(self) -> BoxedStrategy<Self::Value>
where
    Self: Sized + 'static,

Auto Trait Implementations

impl<T> !RefUnwindSafe for BoxedStrategy<T>

impl<T> !Send for BoxedStrategy<T>

impl<T> !Sync for BoxedStrategy<T>

impl<T> !UnwindSafe for BoxedStrategy<T>

impl<T> Freeze for BoxedStrategy<T> where Arc<dyn Strategy<Tree = Box<dyn ValueTree<Value = T>>, Value = T>>: Freeze,

impl<T> Unpin for BoxedStrategy<T> where Arc<dyn Strategy<Tree = Box<dyn ValueTree<Value = T>>, Value = T>>: Unpin,

impl<T> UnsafeUnpin for BoxedStrategy<T> where Arc<dyn Strategy<Tree = Box<dyn ValueTree<Value = T>>, Value = T>>: UnsafeUnpin,

Blanket Implementations

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

impl<T> Borrow<T> for BoxedStrategy<T> where T: ?Sized,

impl<T> BorrowMut<T> for BoxedStrategy<T> where T: ?Sized,

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

impl<T> From<T> for BoxedStrategy<T>

impl<T> ToOwned for BoxedStrategy<T> where T: Clone,

impl<T, U> Into<U> for BoxedStrategy<T> where U: From<T>,

impl<T, U> TryFrom<U> for BoxedStrategy<T> where U: Into<T>,

impl<T, U> TryInto<U> for BoxedStrategy<T> where U: TryFrom<T>,