pub unsafe trait RawMutexTimed: RawMutex {
    type Duration;
    type Instant;

    // Required methods
    fn try_lock_for(&self, timeout: Self::Duration) -> bool;
    fn try_lock_until(&self, timeout: Self::Instant) -> bool;
}
Expand description

Additional methods for mutexes which support locking with timeouts.

The Duration and Instant types are specified as associated types so that this trait is usable even in no_std environments.

Required Associated Types§

type Duration

Duration type used for try_lock_for.

type Instant

Instant type used for try_lock_until.

Required Methods§

fn try_lock_for(&self, timeout: Self::Duration) -> bool

Attempts to acquire this lock until a timeout is reached.

fn try_lock_until(&self, timeout: Self::Instant) -> bool

Attempts to acquire this lock until a timeout is reached.

Implementations on Foreign Types§

source§

impl RawMutexTimed for RawFairMutex

source§

impl RawMutexTimed for RawMutex

§

type Duration = Duration

§

type Instant = Instant

source§

fn try_lock_until(&self, timeout: Instant) -> bool

source§

fn try_lock_for(&self, timeout: Duration) -> bool

Implementors§

source§

impl RawMutexTimed for holochain::prelude::kitsune_p2p::dependencies::kitsune_p2p_types::dependencies::lair_keystore_api::dependencies::parking_lot::RawFairMutex

source§

impl RawMutexTimed for holochain::prelude::kitsune_p2p::dependencies::kitsune_p2p_types::dependencies::lair_keystore_api::dependencies::parking_lot::RawMutex