tellus 0.2.1

A resilient world of actors for Rust: typed messages, supervision trees, death watch, event sourcing.
Documentation
1
2
3
4
5
6
7
use std::sync::{Mutex, MutexGuard, PoisonError};

/// Recover from poisoning: a panic contained by supervision must not disable the guarded
/// structure, none of which this crate leaves inconsistent.
pub(crate) fn lock<T>(mutex: &Mutex<T>) -> MutexGuard<'_, T> {
    mutex.lock().unwrap_or_else(PoisonError::into_inner)
}