north_common/
state.rs

1
2
3pub trait NorthStateDataClone {
4    fn clone_box(&self) -> Box<dyn NorthStateData>;
5}
6
7impl<T> NorthStateDataClone for T
8where
9    T: 'static + NorthStateData + Clone,
10{
11    fn clone_box(&self) -> Box<dyn NorthStateData> {
12        Box::new(self.clone())
13    }
14}
15
16impl Clone for Box<dyn NorthStateData> {
17    fn clone(&self) -> Box<dyn NorthStateData> {
18        self.clone_box()
19    }
20}
21
22pub trait NorthStateData: NorthStateDataClone + Send + Sync {}