pub trait MockCall<I, O, W, Fut>: CallMock<I, O, Fut> {
// Required methods
fn mock_once(&self, with: W);
fn mock_repeat(&self, repeat: Option<usize>, with: W);
}
Expand description
Auto-implemented trait for mocking return values of functions.
Works for:
- functions/methods,
- async functions/methods,
- trait methods, and
- async_trait methods.
The trait is implemented for functions with up to 12 arguments.
Required Methods§
sourcefn mock_once(&self, with: W)
fn mock_once(&self, with: W)
Mock the return value of this function. This expects a closure with the arguments of the function.