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 #[automock] 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 #[automock] 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 #[automock] 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 #[automock] 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 Expectationwhere
MockallOutput: Clone + Into<()> + Send + '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 #[automock] mod ffi { extern “C” { fn foo … } }
pub fn return_const<MockallOutput>(
&mut self,
__mockall_c: MockallOutput
) -> &mut Expectationwhere
MockallOutput: Clone + Into<()> + Send + 'static,
Just like
Expectation::return_const
sourcepub fn return_const_st<MockallOutput>(
&mut self,
__mockall_c: MockallOutput
) -> &mut Expectationwhere
MockallOutput: Clone + Into<()> + '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 #[automock] mod ffi { extern “C” { fn foo … } }
pub fn return_const_st<MockallOutput>(
&mut self,
__mockall_c: MockallOutput
) -> &mut Expectationwhere
MockallOutput: Clone + Into<()> + 'static,
Just like
Expectation::return_const_st
sourcepub fn returning<MockallF>(&mut self, __mockall_f: MockallF) -> &mut Expectationwhere
MockallF: FnMut() + Send + '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 #[automock] mod ffi { extern “C” { fn foo … } }
pub fn returning<MockallF>(&mut self, __mockall_f: MockallF) -> &mut Expectationwhere
MockallF: FnMut() + Send + 'static,
Just like
Expectation::returning
sourcepub fn return_once<MockallF>(
&mut self,
__mockall_f: MockallF
) -> &mut Expectationwhere
MockallF: FnOnce() + Send + '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 #[automock] mod ffi { extern “C” { fn foo … } }
pub fn return_once<MockallF>(
&mut self,
__mockall_f: MockallF
) -> &mut Expectationwhere
MockallF: FnOnce() + Send + 'static,
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 #[automock] 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 #[automock] 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 #[automock] 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 #[automock] 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 Expectationwhere
MockallF: Fn() -> bool + Send + '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 #[automock] mod ffi { extern “C” { fn foo … } }
pub fn withf<MockallF>(&mut self, __mockall_f: MockallF) -> &mut Expectationwhere
MockallF: Fn() -> bool + Send + 'static,
Just like
Expectation::withf
sourcepub fn withf_st<MockallF>(&mut self, __mockall_f: MockallF) -> &mut Expectationwhere
MockallF: Fn() -> bool + '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 #[automock] mod ffi { extern “C” { fn foo … } }
pub fn withf_st<MockallF>(&mut self, __mockall_f: MockallF) -> &mut Expectationwhere
MockallF: Fn() -> bool + 'static,
Just like
Expectation::withf_st