Struct simulacrum_mock::mock::Expectations [] [src]

pub struct Expectations { /* fields omitted */ }

Methods

impl Expectations
[src]

[src]

Create a new Expectations instance. Call this when your mock object is created.

[src]

Returns a Method struct which you can use to add expectations for the method with the given name.

Important traits for &'a mut W
[src]

Begin a new Era. Expectations in one Era must be met before expectations in future eras will be evaluated.

Note that Eras are evaluated eagerly. This means that Eras may advance more quickly than you'd intuitively expect in certain situations. For example, called_any() is marked as complete after the first call is received. This menas that, for the purposes of telling if an Era should be advanced or not, called_any() and called_once() are the same.

[src]

When a tracked method is called on the mock object, call this with the method's name in order to tell the Expectations that the method was called.

Unlike was_called_returning, this method does not return a value.

[src]

Same as the was_called method, but also returns the result.

Trait Implementations

impl Drop for Expectations
[src]

[src]

All expectations will be verified when the mock object is dropped, panicking if any of them are unmet.

In the case where the Expectations object is being dropped because the thread is already panicking, the Expectations object is not verified.

Auto Trait Implementations

impl !Send for Expectations

impl !Sync for Expectations