pub struct MockLocator<I, O, R, B> { /* private fields */ }Expand description
Mock locator returned by mock_* methods
Implementations§
Source§impl<I, O, R, B> MockLocator<I, O, R, B>
 
impl<I, O, R, B> MockLocator<I, O, R, B>
Sourcepub fn returns_with<T: Into<B>>(self, behavior: T) -> Self
 
pub fn returns_with<T: Into<B>>(self, behavior: T) -> Self
Returns value with using a closure. Arguments of a method call are passed to the given closure.
Source§impl<I, O, R, B> MockLocator<I, O, R, B>
 
impl<I, O, R, B> MockLocator<I, O, R, B>
Sourcepub fn returns_once(self, ret: R) -> Self
 
pub fn returns_once(self, ret: R) -> Self
Returns value once. After that, it panics.
Sourcepub fn calls_real_impl(self) -> Self
 
pub fn calls_real_impl(self) -> Self
This make the mock calls real impl. This is used for partial mocking.
Sourcepub fn assert_called(&self, times: impl Into<Times>)
 
pub fn assert_called(&self, times: impl Into<Times>)
Assert the mock is called.
Returns MockResult allows to call times(n)
Panics if not called
Source§impl<I, O, R, B> MockLocator<I, O, R, B>where
    O: MockableRet + Clone,
 
impl<I, O, R, B> MockLocator<I, O, R, B>where
    O: MockableRet + Clone,
Auto Trait Implementations§
impl<I, O, R, B> Freeze for MockLocator<I, O, R, B>
impl<I, O, R, B> !RefUnwindSafe for MockLocator<I, O, R, B>
impl<I, O, R, B> !Send for MockLocator<I, O, R, B>
impl<I, O, R, B> !Sync for MockLocator<I, O, R, B>
impl<I, O, R, B> Unpin for MockLocator<I, O, R, B>
impl<I, O, R, B> !UnwindSafe for MockLocator<I, O, R, B>
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