mockall::examples::mock_ffi::__ffi_func

Struct ExpectationGuard

Source
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>,

SourceĀ§

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>,

SourceĀ§

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.