pub struct ExpectationGuard<'__mockall_lt> { /* private fields */ }
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>

source

pub fn in_sequence(&mut self, __mockall_seq: &mut Sequence) -> &mut Expectation

source

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

source

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

source

pub fn return_const<MockallOutput>( &mut self, __mockall_c: MockallOutput ) -> &mut Expectation
where MockallOutput: Clone + Into<i32> + Send + 'static,

source

pub fn return_const_st<MockallOutput>( &mut self, __mockall_c: MockallOutput ) -> &mut Expectation
where MockallOutput: Clone + Into<i32> + 'static,

source

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

source

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

source

pub fn return_once_st<MockallF>( &mut self, __mockall_f: MockallF ) -> &mut Expectation
where MockallF: FnOnce(i32) -> i32 + 'static,

source

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

source

pub fn times<MockallR>(&mut self, __mockall_r: MockallR) -> &mut Expectation
where MockallR: Into<TimesRange>,

source

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

source

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

source

pub fn withf_st<MockallF>(&mut self, __mockall_f: MockallF) -> &mut Expectation
where MockallF: Fn(&i32) -> bool + 'static,

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
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Any for T
where T: Any + ?Sized,

source§

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> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.