cmd.rs 296 B

12345678910
  1. use serde::Deserialize;
  2. #[derive(Deserialize)]
  3. #[serde(tag = "cmd", rename_all = "camelCase")]
  4. pub enum Cmd {
  5. // your custom commands
  6. // multiple arguments are allowed
  7. // note that rename_all = "camelCase": you need to use "myCustomCommand" on JS
  8. MyCustomCommand { argument: String },
  9. }