Method lrs::sync::Lock::try_lock

Tries to lock the lock if it's currently unlocked.

Syntax

impl<'a> Lock {
    fn try_lock(&'a self) -> Option<LockGuard<'a>>
}

Return value

Returns a guard if the operation succeeded.