Skip to main content

LockAfter

Trait LockAfter 

Source
pub trait LockAfter<A> { }
Expand description

Marker trait that indicates that Self can be locked after A.

This should be implemented for lock types to specify that, in the lock ordering graph, A comes before Self. So if B: LockAfter<A>, lock type B can be acquired after A but A cannot be acquired after B.

Note, though, that it’s preferred to use the [impl_lock_after] macro instead of writing trait impls directly to avoid the possibility of lock ordering cycles.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§