pub struct Context { /* private fields */ }
👎Deprecated since 0.9.0: Using automock directly on an extern block is deprecated. Instead, wrap the extern block in a module, and automock that, like #[automock] mod ffi { extern “C” { fn foo … } }
Expand description
Manages the context for expectations of static methods.
Expectations on this method will be validated and cleared when
the Context
object drops. The Context
object does not
provide any form of synchronization, so multiple tests that set
expectations on the same static method must provide their own.
Implementations
sourceimpl Context
impl Context
sourcepub fn checkpoint(&self)
👎Deprecated since 0.9.0: Using automock directly on an extern block is deprecated. Instead, wrap the extern block in a module, and automock that, like #[automock] mod ffi { extern “C” { fn foo … } }
pub fn checkpoint(&self)
Verify that all current expectations for this method are satisfied and clear them.
sourcepub fn expect<'__mockall_lt>(&self) -> ExpectationGuard<'__mockall_lt>
👎Deprecated since 0.9.0: Using automock directly on an extern block is deprecated. Instead, wrap the extern block in a module, and automock that, like #[automock] mod ffi { extern “C” { fn foo … } }
pub fn expect<'__mockall_lt>(&self) -> ExpectationGuard<'__mockall_lt>
Create a new expectation for this method.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Context
impl Send for Context
impl !Sync for Context
impl Unpin for Context
impl !UnwindSafe for Context
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more