pub struct MockBoo { /* private fields */ }
Expand description

Mock of a struct

Structs can be mocked with mock!. Their mock methods have an identical API to the methods generated by #[automock].

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

👎Deprecated since 0.9.0: Deprecated mock! syntax. Instead of “trait X”, write “impl X for Y”. See PR #205

Create an Expectation for mocking the bah method

Trait Implementations

An implementation of a trait on a mocked struct

Some trait method
Returns the “default value” for a type. Read more

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.