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<ST, DT> CastableFrom<ST, Initialized, Initialized> for BoxedStrategy<T> where ST: ?Sized, DT: ?Sized,

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

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

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

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

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

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

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

fn from(t: T) -> T

Returns the argument unchanged.

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

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

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

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

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

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

fn vzip(self) -> V