blob: 26ae1bb745bb78fc69f59e423f5bcf6bd57b8004 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
use std::marker::Sized;
pub mod callback;
pub mod not_understood;
#[derive(Serialize)]
pub struct OutgoingMsg<T> {
pub result_type: String,
pub content: T,
}
pub trait Message {
fn name(&self) -> String;
fn as_outgoing(self) -> OutgoingMsg<Self>
where
Self: Sized,
{
OutgoingMsg {
result_type: self.name(),
content: self,
}
}
}
|