Mountain/RPC/commands.rs
1//! # Commands RPC Service
2//!
3//! Command registration and execution service.
4
5use std::collections::HashMap;
6
7use serde::{Deserialize, Serialize};
8
9/// Command service
10pub struct CommandService {
11 commands:HashMap<String, String>,
12}
13
14impl CommandService {
15 pub fn new() -> Self { Self { commands:HashMap::new() } }
16}
17
18impl Default for CommandService {
19 fn default() -> Self { Self::new() }
20}
21
22/// Command validation
23pub struct CommandValidation;
24
25impl CommandValidation {
26 pub fn new() -> Self { Self {} }
27}
28
29impl Default for CommandValidation {
30 fn default() -> Self { Self::new() }
31}
32
33/// Command definition
34#[derive(Debug, Clone, Serialize, Deserialize)]
35pub struct Command {
36 pub id:String,
37 pub title:String,
38 pub description:Option<String>,
39}