pub unsafe trait RawRwLockTimed: RawRwLock {
type Duration;
type Instant;
// Required methods
fn try_lock_shared_for(&self, timeout: Self::Duration) -> bool;
fn try_lock_shared_until(&self, timeout: Self::Instant) -> bool;
fn try_lock_exclusive_for(&self, timeout: Self::Duration) -> bool;
fn try_lock_exclusive_until(&self, timeout: Self::Instant) -> bool;
}
Expand description
Additional methods for RwLocks 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§
Required Methods§
Attempts to acquire a shared lock until a timeout is reached.
Attempts to acquire a shared lock until a timeout is reached.
Sourcefn try_lock_exclusive_for(&self, timeout: Self::Duration) -> bool
fn try_lock_exclusive_for(&self, timeout: Self::Duration) -> bool
Attempts to acquire an exclusive lock until a timeout is reached.
Sourcefn try_lock_exclusive_until(&self, timeout: Self::Instant) -> bool
fn try_lock_exclusive_until(&self, timeout: Self::Instant) -> bool
Attempts to acquire an exclusive lock until a timeout is reached.
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.