1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#[derive(Abomonation, Debug, PartialEq, Eq, Hash, Clone, Copy)]
pub struct CommunicationSetup {
pub sender: bool,
pub process: usize,
pub remote: Option<usize>,
}
#[derive(Abomonation, Debug, PartialEq, Eq, Hash, Clone, Copy)]
pub enum CommunicationEvent {
Message(MessageEvent),
State(StateEvent),
}
#[derive(Abomonation, Debug, PartialEq, Eq, Hash, Clone, Copy)]
pub struct MessageEvent {
pub is_send: bool,
pub header: ::networking::MessageHeader,
}
#[derive(Abomonation, Debug, PartialEq, Eq, Hash, Clone, Copy)]
pub struct StateEvent {
pub send: bool,
pub process: usize,
pub remote: usize,
pub start: bool,
}
impl From<MessageEvent> for CommunicationEvent {
fn from(v: MessageEvent) -> CommunicationEvent { CommunicationEvent::Message(v) }
}
impl From<StateEvent> for CommunicationEvent {
fn from(v: StateEvent) -> CommunicationEvent { CommunicationEvent::State(v) }
}