Trait SpinGuardian

Source
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§

Source

type Guard: AsAtomicModeGuard + GuardTransfer

The guard type for holding a spin lock or a spin-based write lock.

Source

type ReadGuard: AsAtomicModeGuard + GuardTransfer

The guard type for holding a spin-based read lock.

Required Methods§

Source

fn guard() -> Self::Guard

Creates a new guard.

Source

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.

Implementors§