pub trait CallReal {
    fn real_switch(&self) -> &RealCallSwitch;

    fn call_real<R>(&self, action: impl FnOnce() -> R) -> R { ... }
    fn call_real_once<R>(&self, action: impl FnOnce() -> R) -> R { ... }
}
Expand description

Controls delegation to real impls. The provided call_* methods in this trait can be used for partial mocking and spying.

Required Methods

Returns a reference to the call switch.

Provided Methods

Runs the provided closure with all calls to the mocked function / method being directed to “real” implementation.

Runs the provided closure with the first call to the mocked function / method being directed to “real” implementation. Further calls will be directed to the mock.

Implementors