lib-nested/src/core/view.rs

25 lines
454 B
Rust
Raw Normal View History

2021-01-06 21:35:46 +01:00
/*\
<<<<>>>><<>><><<>><<<*>>><<>><><<>><<<<>>>>
View
<<<<>>>><<>><><<>><<<*>>><<>><><<>><<<<>>>>
\*/
pub trait View : Send + Sync {
/// Notification message for the observers
type Msg;
}
//<<<<>>>><<>><><<>><<<*>>><<>><><<>><<<<>>>>
use std::sync::{Arc, RwLock};
impl<V: View> View for RwLock<V> {
type Msg = V::Msg;
}
impl<V: View> View for Arc<V> {
type Msg = V::Msg;
}