Trait mimicry::Mock

source ·
pub trait Mock: Sized {
    fn set_as_mock(self) -> MockGuard<Self> { ... }
    fn lock() -> EmptyGuard<Self>
    where
        Self::Shared: LockMock<'static, Self::Base>
, { ... } }
Expand description

State of a mock.

This trait should be implemented via the corresponding derive macro; parts of it are non-documented and subject to change.

Provided Methods

Sets the mock state and returns an exclusive guard to the shared state.

Locks write access to the mock state without setting the state. This is useful for shared mocks to ensure that tests not using mocks do not observe mocks set by other tests.

Implementors