pub trait SpinGuardian {
type Guard: AsAtomicModeGuard + GuardTransfer;
type ReadGuard: AsAtomicModeGuard + GuardTransfer;
// Required methods
fn guard() -> Self::Guard;
fn read_guard() -> Self::ReadGuard;
}
Expand description
A guardian that denotes the guard behavior for holding a spin-based lock.
It at least ensures that the atomic mode is maintained while the lock is held.
Required Associated Types§
Sourcetype Guard: AsAtomicModeGuard + GuardTransfer
type Guard: AsAtomicModeGuard + GuardTransfer
The guard type for holding a spin lock or a spin-based write lock.
Sourcetype ReadGuard: AsAtomicModeGuard + GuardTransfer
type ReadGuard: AsAtomicModeGuard + GuardTransfer
The guard type for holding a spin-based read lock.
Required Methods§
Sourcefn read_guard() -> Self::ReadGuard
fn read_guard() -> Self::ReadGuard
Creates a new read guard.
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.