Struct mockall::examples::MockFoo

source ·
pub struct MockFoo { /* private fields */ }
Expand description

Mock of a basic trait with several kinds of method.

It is mocked by the MockFoo struct.

Implementations§

Validate that all current expectations for all methods have been satisfied, and discard them.

Create a new mock object with no expectations.

This method will not be generated if the real struct already has a new method. However, it will be generated if the struct implements a trait with a new method. The trait’s new method can still be called like <MockX as TraitY>::new

Create an Expectation for mocking the foo method

Create an Expectation for mocking the bar method

Create an Expectation for mocking the baz method

Create an Expectation for mocking the bean method

Create a Context for mocking the bang method

Trait Implementations§

Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more

Mock of a basic trait with several kinds of method.

It is mocked by the MockFoo struct.

A method with a 'static return type

A method returning a reference

A method returning a mutable reference

A method returning a 'static reference

A static method

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.