pub struct Candidates<'a> { /* private fields */ }Expand description
The set of mutations that can be applied to a value.
This type is used by mutators to register the mutations that they can
perform on a value. It is passed to the Mutate::mutate trait method, and
provides a way to register candidate mutations, as well as to check if
shrinking is enabled.
Implementations§
Source§impl<'a> Candidates<'a>
impl<'a> Candidates<'a>
Sourcepub fn mutation(
&mut self,
f: impl FnMut(&mut Context) -> Result<()>,
) -> Result<()>
pub fn mutation( &mut self, f: impl FnMut(&mut Context) -> Result<()>, ) -> Result<()>
Register a candidate mutation that can be applied to a value.
This method is called by Mutate::mutate implementations to register
the potential mutations that they can perform on a value.
f should be a closure that performs the mutation on the value that was
passed to Mutate::mutate, updating the value and the mutator itself as
necessary.
See the Mutate::mutate trait method documentation for more
information on this method’s use.
Auto Trait Implementations§
impl<'a> Freeze for Candidates<'a>
impl<'a> RefUnwindSafe for Candidates<'a>
impl<'a> Send for Candidates<'a>
impl<'a> Sync for Candidates<'a>
impl<'a> Unpin for Candidates<'a>
impl<'a> UnsafeUnpin for Candidates<'a>
impl<'a> !UnwindSafe for Candidates<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more