Crate mockers

Source

Re-exports§

pub use crate::type_info::TypeInfo;
pub use clone::CloneMock;

Modules§

cardinality
clone
matchers
type_info

Macros§

arg
check
colored
mock_clone
Implements Clone for mock object.

Structs§

Call
CallMatch0
$call_match (e.g. CallMatch1) struct allows to check whether mock method call matches given criteria.
CallMatch1
$call_match (e.g. CallMatch1) struct allows to check whether mock method call matches given criteria.
CallMatch2
$call_match (e.g. CallMatch1) struct allows to check whether mock method call matches given criteria.
CallMatch3
$call_match (e.g. CallMatch1) struct allows to check whether mock method call matches given criteria.
CallMatch4
$call_match (e.g. CallMatch1) struct allows to check whether mock method call matches given criteria.
CallMatchSend0
Call matcher for methods of Sendable mock. The difference is that argument matchers must also implement Send.
CallMatchSend1
Call matcher for methods of Sendable mock. The difference is that argument matchers must also implement Send.
CallMatchSend2
Call matcher for methods of Sendable mock. The difference is that argument matchers must also implement Send.
CallMatchSend3
Call matcher for methods of Sendable mock. The difference is that argument matchers must also implement Send.
CallMatchSend4
Call matcher for methods of Sendable mock. The difference is that argument matchers must also implement Send.
Expectation0
Expectation1
Expectation2
Expectation3
Expectation4
ExpectationNever
ExpectationSend0
ExpectationSend1
ExpectationSend2
ExpectationSend3
ExpectationSend4
ExpectationTimes0
Expectation combines call matcher with action and cardinality. TODO: Reuse Reaction struct.
ExpectationTimes1
Expectation combines call matcher with action and cardinality. TODO: Reuse Reaction struct.
ExpectationTimes2
Expectation combines call matcher with action and cardinality. TODO: Reuse Reaction struct.
ExpectationTimes3
Expectation combines call matcher with action and cardinality. TODO: Reuse Reaction struct.
ExpectationTimes4
Expectation combines call matcher with action and cardinality. TODO: Reuse Reaction struct.
ExpectationTimesSend0
Variation of expectation for Sendable mocks.
ExpectationTimesSend1
Variation of expectation for Sendable mocks.
ExpectationTimesSend2
Variation of expectation for Sendable mocks.
ExpectationTimesSend3
Variation of expectation for Sendable mocks.
ExpectationTimesSend4
Variation of expectation for Sendable mocks.
MethodData
Reaction0
Reaction combines call matcher with action which is executed when call matches. It doesn’t yet specify how many times call is allowed to be matched. Reaction is created using
Reaction1
Reaction combines call matcher with action which is executed when call matches. It doesn’t yet specify how many times call is allowed to be matched. Reaction is created using
Reaction2
Reaction combines call matcher with action which is executed when call matches. It doesn’t yet specify how many times call is allowed to be matched. Reaction is created using
Reaction3
Reaction combines call matcher with action which is executed when call matches. It doesn’t yet specify how many times call is allowed to be matched. Reaction is created using
Reaction4
Reaction combines call matcher with action which is executed when call matches. It doesn’t yet specify how many times call is allowed to be matched. Reaction is created using
ReactionSend0
Reaction for Sendable mock methods.
ReactionSend1
Reaction for Sendable mock methods.
ReactionSend2
Reaction for Sendable mock methods.
ReactionSend3
Reaction for Sendable mock methods.
ReactionSend4
Reaction for Sendable mock methods.
Scenario
ScenarioHandle
ScenarioInternals
SendWrapper
A wrapper which allows you to move around non-Send-types between threads, as long as you access the contained value only from within the original thread and make sure that it is dropped from within the original thread.
Sequence
Expectation combinator which ensures that nested expectations are satisfied in specified order.

Constants§

EXTERN_MOCKS

Traits§

CallMatch
DebugOnStable
This trait is equivalent to Debug on non-nightly compilers, and is implemented for all types on nightly compilers. ? formatting.
Expectation
Expectation is a combination of call match and corresponding action.
MatchArg
Argument matcher
Mock
MockHandle
Mocked
Satisfy

Type Aliases§

MockRef

Derive Macros§

DebugOnStable
This trait is equivalent to Debug on non-nightly compilers, and is implemented for all types on nightly compilers. Derive macro generating an impl of the trait Debug.