Struct LazyJust
#[must_use = "strategies do nothing unless used"]
pub struct LazyJust<T, F: Fn() -> T> { /* private fields */ }
A Strategy which always produces a single value and never
simplifies. If T is Clone, you should use Just instead.
This is a generalization of Just and works by calling
the provided Fn () -> T in .current() every time. This is not a
very interesting strategy, but is required in cases where T is
not Clone. It is also used in proptest_derive where we can't
assume that your type is Clone.
It is important that the function used be pure.
Implementations
impl<T, F: Fn() -> T> LazyJust<T, F>
fn new(function: F) -> SelfConstructs a
LazyJuststrategy given the function/closure that produces the value.It is important that the function used be pure.
Trait Implementations
impl<T, F: Clone + Fn() -> T> Clone for LazyJust<T, F>
fn clone(&self) -> Self
impl<T, F: Copy + Fn() -> T> Copy for LazyJust<T, F>
impl<T, F: Fn() -> T> Debug for LazyJust<T, F>
fn fmt(&self, fmt: &mut Formatter<'_>) -> Result
impl<T: Debug, F: Clone + Fn() -> T> Strategy for LazyJust<T, F>
type Tree = LazyJust<T, F>;type Value = T;fn new_tree(&self, &mut TestRunner) -> NewTree<Self>
impl<T: Debug, F: Fn() -> T> ValueTree for LazyJust<T, F>
type Value = T;fn simplify(&mut self) -> boolfn complicate(&mut self) -> boolfn current(&self) -> Self::Value