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 #[automoock] 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ยง
Sourceยงimpl 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 #[automoock] 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 #[automoock] 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 Freeze for Context
impl !RefUnwindSafe for Context
impl Send for Context
impl !Sync for Context
impl Unpin for Context
impl !UnwindSafe for Context
Blanket Implementationsยง
Sourceยงimpl<T> Any for T
impl<T> Any for T
Sourceยงfn type_id_compat(&self) -> TypeId
fn type_id_compat(&self) -> TypeId
TODO: once 1.33.0 is the minimum supported compiler version, remove
Any::type_id_compat and use StdAny::type_id instead.
https://github.com/rust-lang/rust/issues/27745
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