Skip to main content

LockTokenRead

Trait LockTokenRead 

Source
pub trait LockTokenRead<Class, Idx = TokenIndexHere> { }
Expand description

Trait implemented by lock tokens that grant shared (read) access to a cell guarded by Class.

When a cell is guarded by a single lock C, holding LockToken<'_, C> grants read access. When a cell is guarded by multiple locks (C0, C1, ...), holding ANY one of the constituent locks grants read access, because mutating the cell requires holding ALL constituent locks simultaneously.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<Class> LockTokenRead<Class> for LockToken<'_, Class>