SafeLock

Trait SafeLock 

Source
pub trait SafeLock<T> {
    // Required methods
    fn safe_lock(&self) -> TrackingResult<MutexGuard<'_, T>>;
    fn try_safe_lock(&self) -> TrackingResult<Option<MutexGuard<'_, T>>>;
}
Expand description

Safe lock operations - replaces .lock().expect(“Failed to acquire lock”)

Required Methods§

Source

fn safe_lock(&self) -> TrackingResult<MutexGuard<'_, T>>

Safely acquire lock with timeout and error handling

Source

fn try_safe_lock(&self) -> TrackingResult<Option<MutexGuard<'_, T>>>

Try to acquire lock without blocking

Implementations on Foreign Types§

Source§

impl<T> SafeLock<T> for Mutex<T>

Implementors§