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 #[automoock] 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>

source

pub 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 #[automoock] mod ffi { extern “C” { fn foo … } }
source

pub 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 #[automoock] mod ffi { extern “C” { fn foo … } }
source

pub 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 #[automoock] mod ffi { extern “C” { fn foo … } }
source

pub fn return_const<MockallOutput>( &mut self, __mockall_c: MockallOutput ) -> &mut Expectation
where 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 #[automoock] mod ffi { extern “C” { fn foo … } }
source

pub fn return_const_st<MockallOutput>( &mut self, __mockall_c: MockallOutput ) -> &mut Expectation
where 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 #[automoock] mod ffi { extern “C” { fn foo … } }
source

pub fn returning<MockallF>(&mut self, __mockall_f: MockallF) -> &mut Expectation
where 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 #[automoock] mod ffi { extern “C” { fn foo … } }
source

pub fn return_once<MockallF>( &mut self, __mockall_f: MockallF ) -> &mut Expectation
where 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 #[automoock] mod ffi { extern “C” { fn foo … } }
source

pub fn return_once_st<MockallF>( &mut self, __mockall_f: MockallF ) -> &mut Expectation
where 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 #[automoock] mod ffi { extern “C” { fn foo … } }
source

pub fn returning_st<MockallF>( &mut self, __mockall_f: MockallF ) -> &mut Expectation
where 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 #[automoock] mod ffi { extern “C” { fn foo … } }
source

pub fn times<MockallR>(&mut self, __mockall_r: MockallR) -> &mut Expectation
where 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 #[automoock] mod ffi { extern “C” { fn foo … } }
source

pub 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 #[automoock] mod ffi { extern “C” { fn foo … } }
source

pub fn withf<MockallF>(&mut self, __mockall_f: MockallF) -> &mut Expectation
where 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 #[automoock] mod ffi { extern “C” { fn foo … } }
source

pub fn withf_st<MockallF>(&mut self, __mockall_f: MockallF) -> &mut Expectation
where 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 #[automoock] mod ffi { extern “C” { fn foo … } }

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.