Skip to main content

MutexAssertions

Trait MutexAssertions 

Source
pub trait MutexAssertions {
    // Required methods
    fn is_locked(self) -> Self;
    fn is_not_locked(self) -> Self;

    // Provided method
    fn is_free(self) -> Self
       where Self: Sized { ... }
}

Required Methods§

Source

fn is_locked(self) -> Self

Asserts that this mutex is locked. Note that implementations may try to acquire the lock in order to check its state.

Source

fn is_not_locked(self) -> Self

Asserts that this mutex is not locked. Note that implementations may try to acquire the lock in order to check its state.

Provided Methods§

Source

fn is_free(self) -> Self
where Self: Sized,

Asserts that this mutex is not locked. Note that implementations may try to acquire the lock in order to check its state.

Synonym for Self::is_not_locked.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T: Debug, M: Mode> MutexAssertions for AssertThat<'_, Mutex<T>, M>