[]Struct mockall_examples::__mock_Foo_Foo::bang::ExpectationGuard

pub struct ExpectationGuard<'guard> { /* fields omitted */ }

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

pub fn never(&mut self) -> &mut Expectation

pub fn once(&mut self) -> &mut Expectation

pub fn returning<F>(&mut self, f: F) -> &mut Expectation where
    F: FnMut(i32) -> i32 + Send + 'static, 

pub fn return_once<F>(&mut self, f: F) -> &mut Expectation where
    F: FnOnce(i32) -> i32 + Send + 'static, 

pub fn returning_st<F>(&mut self, f: F) -> &mut Expectation where
    F: FnMut(i32) -> i32 + 'static, 

pub fn times(&mut self, n: usize) -> &mut Expectation

pub fn times_any(&mut self) -> &mut Expectation

pub fn times_range(&mut self, range: Range<usize>) -> &mut Expectation

pub fn with<p0: Predicate<i32> + Send + 'static>(
    &mut self,
    x: p0
) -> &mut Expectation

pub fn withf<F>(&mut self, f: F) -> &mut Expectation where
    F: Fn(&i32) -> bool + Send + 'static, 

Auto Trait Implementations

impl<'guard> !Send for ExpectationGuard<'guard>

impl<'guard> Unpin for ExpectationGuard<'guard>

impl<'guard> Sync for ExpectationGuard<'guard>

impl<'guard> UnwindSafe for ExpectationGuard<'guard>

impl<'guard> RefUnwindSafe for ExpectationGuard<'guard>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Any for T where
    T: Any + ?Sized
[src]

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