Struct mockall::examples::mock_ffi::__ffi_func::ExpectationGuard
source · pub struct ExpectationGuard<'__mockall_lt> { /* 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
Like an &Expectation
but
protected by a Mutex guard. Useful for mocking static
methods. Forwards accesses to an Expectation
object.
Implementations§
source§impl<'__mockall_lt> ExpectationGuard<'__mockall_lt>
impl<'__mockall_lt> ExpectationGuard<'__mockall_lt>
sourcepub fn in_sequence(&mut self, __mockall_seq: &mut Sequence) -> &mut Expectation
👎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 in_sequence(&mut self, __mockall_seq: &mut Sequence) -> &mut Expectation
Just like
Expectation::in_sequence
sourcepub fn never(&mut self) -> &mut Expectation
👎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 never(&mut self) -> &mut Expectation
Just like
Expectation::never
sourcepub fn once(&mut self) -> &mut Expectation
👎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 once(&mut self) -> &mut Expectation
Just like
Expectation::once
sourcepub fn return_const<MockallOutput>(
&mut self,
__mockall_c: MockallOutput
) -> &mut Expectation
👎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 return_const<MockallOutput>( &mut self, __mockall_c: MockallOutput ) -> &mut Expectation
Just like
Expectation::return_const
sourcepub fn return_const_st<MockallOutput>(
&mut self,
__mockall_c: MockallOutput
) -> &mut Expectation
👎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 return_const_st<MockallOutput>( &mut self, __mockall_c: MockallOutput ) -> &mut Expectation
Just like
Expectation::return_const_st
sourcepub fn returning<MockallF>(&mut self, __mockall_f: MockallF) -> &mut Expectation
👎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 returning<MockallF>(&mut self, __mockall_f: MockallF) -> &mut Expectation
Just like
Expectation::returning
sourcepub fn return_once<MockallF>(
&mut self,
__mockall_f: MockallF
) -> &mut Expectation
👎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 return_once<MockallF>( &mut self, __mockall_f: MockallF ) -> &mut Expectation
Just like
Expectation::return_once
sourcepub fn return_once_st<MockallF>(
&mut self,
__mockall_f: MockallF
) -> &mut Expectationwhere
MockallF: FnOnce() + 'static,
👎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 return_once_st<MockallF>(
&mut self,
__mockall_f: MockallF
) -> &mut Expectationwhere
MockallF: FnOnce() + 'static,
Just like
Expectation::return_once_st
sourcepub fn returning_st<MockallF>(
&mut self,
__mockall_f: MockallF
) -> &mut Expectationwhere
MockallF: FnMut() + 'static,
👎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 returning_st<MockallF>(
&mut self,
__mockall_f: MockallF
) -> &mut Expectationwhere
MockallF: FnMut() + 'static,
Just like
Expectation::returning_st
sourcepub fn times<MockallR>(&mut self, __mockall_r: MockallR) -> &mut Expectationwhere
MockallR: Into<TimesRange>,
👎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 times<MockallR>(&mut self, __mockall_r: MockallR) -> &mut Expectationwhere
MockallR: Into<TimesRange>,
Just like
Expectation::times
sourcepub fn with(&mut self) -> &mut Expectation
👎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 with(&mut self) -> &mut Expectation
Just like
Expectation::with
sourcepub fn withf<MockallF>(&mut self, __mockall_f: MockallF) -> &mut Expectation
👎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 withf<MockallF>(&mut self, __mockall_f: MockallF) -> &mut Expectation
Just like
Expectation::withf
sourcepub fn withf_st<MockallF>(&mut self, __mockall_f: MockallF) -> &mut Expectation
👎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 withf_st<MockallF>(&mut self, __mockall_f: MockallF) -> &mut Expectation
Just like
Expectation::withf_st
Auto Trait Implementations§
impl<'__mockall_lt> Freeze for ExpectationGuard<'__mockall_lt>
impl<'__mockall_lt> RefUnwindSafe for ExpectationGuard<'__mockall_lt>
impl<'__mockall_lt> !Send for ExpectationGuard<'__mockall_lt>
impl<'__mockall_lt> Sync for ExpectationGuard<'__mockall_lt>
impl<'__mockall_lt> Unpin for ExpectationGuard<'__mockall_lt>
impl<'__mockall_lt> UnwindSafe for ExpectationGuard<'__mockall_lt>
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