-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlib.rs
More file actions
27 lines (22 loc) · 649 Bytes
/
Copy pathlib.rs
File metadata and controls
27 lines (22 loc) · 649 Bytes
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
use std::{any::Any, num::Wrapping};
#[derive(Debug, Clone)]
#[allow(unused)]
pub enum EnumMsgs {
Quit,
Move { x: Wrapping<i32>, y: Wrapping<i32> },
Write(String),
}
// Messages are things that implement trait std::any::Any
// which is most anything
pub type MsgAny = dyn Any;
// This type alias is generic and apparently can't be exported
// but Message can, oh well.
//pub type SmProcessMsgFn<SM> = fn(&mut SM, Box<Message>);
// Dispatch a message
pub trait ProcessMsgAny {
fn process_msg_any(&mut self, msg: Box<MsgAny>);
}
pub mod sm_enum_msgs;
pub mod sm_enum_msgs_any;
pub mod sm_separate_msgs_any;
pub mod sm_string_msgs;