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
pub use self::{event::*, opts::*, specs::*};
pub(crate) mod event;
pub(crate) mod opts;
pub(crate) mod specs {
use scsys::prelude::{Message, Timestamp};
pub trait Eventful {
type Event;
fn event(&self) -> Self::Event;
}
pub trait EventSpec: Eventful {
type Data: Clone;
fn message(&self) -> &Message<Self::Data>;
fn timestamp(&self) -> Timestamp {
Timestamp::from(self.message().timestamp)
}
fn push(&mut self, data: Self::Data) -> &Self {
self.message().clone().push(data);
self
}
}
pub trait EventSpecExt: EventSpec {
fn signal(&self) -> String;
}
}