pub trait UnlockedAccess<A> {
type Data;
type Guard<'l>: Deref<Target = Self::Data>
where Self: 'l;
// Required method
fn access(&self) -> Self::Guard<'_>;
}
Expand description
Describes how to access state in Self
that doesn’t require locking.
UnlockedAccess
allows access to some state in Self
without acquiring
a lock. Unlike Lock
and friends, the type parameter A
in
UnlockedAccess<A>
is used to provide a label for the state; it is
unrelated to the lock levels for Self
.
In order for this crate to provide guarantees about lock ordering safety,
UnlockedAccess
must only be implemented for accessing state that is
guaranteed to be accessible lock-free.
Required Associated Types§
Required Methods§
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.