[−]Struct mockall_examples::__mock_Foo_Foo::bang::ExpectationGuard
Like an &Expectation
but protected by a
Mutex guard. Useful for mocking static methods. Forwards accesses
to an Expectation
object.
Methods
impl<'guard> ExpectationGuard<'guard>
pub fn in_sequence(&mut self, seq: &mut Sequence) -> &mut Expectation
Just like
Expectation::in_sequence
pub fn never(&mut self) -> &mut Expectation
Just like
Expectation::never
pub fn once(&mut self) -> &mut Expectation
Just like Expectation::once
pub fn returning<F>(&mut self, f: F) -> &mut Expectation where
F: FnMut(i32) -> i32 + Send + 'static,
F: FnMut(i32) -> i32 + Send + 'static,
Just like
Expectation::returning
pub fn return_once<F>(&mut self, f: F) -> &mut Expectation where
F: FnOnce(i32) -> i32 + Send + 'static,
F: FnOnce(i32) -> i32 + Send + 'static,
Just like
Expectation::return_once
pub fn returning_st<F>(&mut self, f: F) -> &mut Expectation where
F: FnMut(i32) -> i32 + 'static,
F: FnMut(i32) -> i32 + 'static,
Just like
Expectation::returning_st
pub fn times(&mut self, n: usize) -> &mut Expectation
Just like
Expectation::times
pub fn times_any(&mut self) -> &mut Expectation
Just like
Expectation::times_any
pub fn times_range(&mut self, range: Range<usize>) -> &mut Expectation
Just like
Expectation::times_range
pub fn with<p0: Predicate<i32> + Send + 'static>(
&mut self,
x: p0
) -> &mut Expectation
&mut self,
x: p0
) -> &mut Expectation
Just like
Expectation::with
pub fn withf<F>(&mut self, f: F) -> &mut Expectation where
F: Fn(&i32) -> bool + Send + 'static,
F: Fn(&i32) -> bool + Send + 'static,
Just like
Expectation::withf
Auto Trait Implementations
impl<'guard> Sync for ExpectationGuard<'guard>
impl<'guard> !Send for ExpectationGuard<'guard>
impl<'guard> Unpin for ExpectationGuard<'guard>
impl<'guard> RefUnwindSafe for ExpectationGuard<'guard>
impl<'guard> UnwindSafe for ExpectationGuard<'guard>
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any + ?Sized,
[src]
T: Any + ?Sized,
fn type_id_compat(&self) -> TypeId
[src]
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 Read more