Struct mockall::examples::mock_ffi::__ffi_func::ExpectationGuard

source ·
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<()> + Send + 'static,

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

pub fn withf_st<MockallF>(&mut self, __mockall_f: MockallF) -> &mut Expectation
where MockallF: Fn() -> 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,

source§

fn into_any(self: Box<T>) -> Box<dyn Any>

source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

source§

fn type_name(&self) -> &'static str

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.