Skip to main content

state_m/
lib.rs

1mod barrier;
2mod handle;
3mod reader;
4mod source;
5mod state;
6mod state_machine;
7
8pub use barrier::*;
9pub use reader::Reader;
10pub use state::*;
11pub use state_m_macro::state_tag;
12pub use state_machine::*;
13use std::{
14    fmt::{Debug, Display},
15    hash::Hash,
16};
17
18/// Associate a Key type and a Value type.
19pub trait KvAssoc {
20    type Value;
21}
22
23/// State type needs to implement these traits: Clone, Debug, Default, PartialEq.
24pub trait AsState: Clone + Debug + Default + Display + PartialEq {}
25
26impl<T> AsState for T where T: Clone + Debug + Default + Display + PartialEq {}
27
28/// Tag type needs to implement these traits: Clone, Debug, Eq, Hash, Send, Sync.
29pub trait AsTag: Clone + Debug + Eq + Hash + Ord + Send + Sync {}
30
31impl<T> AsTag for T where T: Clone + Debug + Eq + Hash + Ord + Send + Sync {}