Struct simulacrum::user::TrackedMethod
[−]
[src]
pub struct TrackedMethod<'a, I, O> { /* fields omitted */ }
Once you've specified the number of times you expect a method to be called, you can specify additional behaviors and expectations through this object's methods.
Methods
impl<'a, I, O> TrackedMethod<'a, I, O> where
I: 'static,
O: 'static,
[src]
I: 'static,
O: 'static,
pub fn with<V>(self, validator: V) -> Self where
V: Validator<I> + 'static,
[src]
V: Validator<I> + 'static,
Specify a Validator
object that will validate parameters when called.
If it returns false
when its validate()
method is called, the
expectation will be invalidated.
pub fn modifying<F>(self, modification_behavior: F) -> Self where
F: 'static + FnMut(&mut I),
[src]
F: 'static + FnMut(&mut I),
Specify a behavior to be executed as a side-effect when the method is called.
The primary use for this is to modify parameters passed as mutable references.
pub fn returning<F>(self, result_behavior: F) -> Self where
F: 'static + FnMut(&I) -> O,
[src]
F: 'static + FnMut(&I) -> O,