SortableLock

Trait SortableLock 

Source
pub trait SortableLock {
    type Guard;

    // Required methods
    fn sort_key(&self) -> SortKey;
    fn lock_presorted(&self) -> Self::Guard;
}
Expand description

A lock that can be locked in a way that ensures that multiple locks are always locked in the same order..

Required Associated Types§

Source

type Guard

The type of the lock guard once locked.

Required Methods§

Source

fn sort_key(&self) -> SortKey

Gets the sort key of the lock.

Source

fn lock_presorted(&self) -> Self::Guard

Lock this lock.

This method assumes that lock sorting has already been done. lock_all from LockGroup should be used if you want to lock with sorting.

Implementors§