11 lines
296 B
Rust
11 lines
296 B
Rust
use serde::Deserialize;
|
|
|
|
#[derive(Deserialize)]
|
|
#[serde(tag = "cmd", rename_all = "camelCase")]
|
|
pub enum Cmd {
|
|
// your custom commands
|
|
// multiple arguments are allowed
|
|
// note that rename_all = "camelCase": you need to use "myCustomCommand" on JS
|
|
MyCustomCommand { argument: String },
|
|
}
|