cosmic_space/wave/core/
cmd.rs

1use serde::{Deserialize, Serialize};
2
3use crate::util::ValueMatcher;
4
5#[derive(
6    Debug,
7    Clone,
8    Serialize,
9    Deserialize,
10    Eq,
11    PartialEq,
12    Hash,
13    strum_macros::Display,
14    strum_macros::EnumString,
15)]
16pub enum CmdMethod {
17    Init,
18    Read,
19    Update,
20    Bounce,
21    Knock,
22    Greet,
23    Command,
24    RawCommand,
25    Log,
26}
27
28impl ValueMatcher<CmdMethod> for CmdMethod {
29    fn is_match(&self, x: &CmdMethod) -> Result<(), ()> {
30        if *x == *self {
31            Ok(())
32        } else {
33            Err(())
34        }
35    }
36}