refactor: derive PartialEq + Eq for core message types (Destination, PlayerCommand, WifiCommand, etc.)
This commit is contained in:
@@ -10,7 +10,7 @@ pub struct Envelope {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// 消息目的地
|
/// 消息目的地
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
pub enum Destination {
|
pub enum Destination {
|
||||||
/// 点对点发送给指定插件
|
/// 点对点发送给指定插件
|
||||||
Plugin(String),
|
Plugin(String),
|
||||||
@@ -68,7 +68,7 @@ pub enum Message {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
pub enum PlayerCommand {
|
pub enum PlayerCommand {
|
||||||
Play,
|
Play,
|
||||||
Pause,
|
Pause,
|
||||||
@@ -88,7 +88,7 @@ pub struct PlayerStatusData {
|
|||||||
pub current_video: Option<String>,
|
pub current_video: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
pub enum WifiCommand {
|
pub enum WifiCommand {
|
||||||
Scan,
|
Scan,
|
||||||
Connect { ssid: String, password: String },
|
Connect { ssid: String, password: String },
|
||||||
@@ -100,7 +100,7 @@ pub enum WifiCommand {
|
|||||||
// ── 设备管理 ──
|
// ── 设备管理 ──
|
||||||
|
|
||||||
/// 像素格式
|
/// 像素格式
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
pub enum PixelFormat {
|
pub enum PixelFormat {
|
||||||
/// RGBA 8888 格式(每像素 4 字节)
|
/// RGBA 8888 格式(每像素 4 字节)
|
||||||
RGBA8888,
|
RGBA8888,
|
||||||
@@ -111,7 +111,7 @@ pub enum PixelFormat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// 传感器类型
|
/// 传感器类型
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
pub enum SensorType {
|
pub enum SensorType {
|
||||||
/// 温度传感器
|
/// 温度传感器
|
||||||
Temperature,
|
Temperature,
|
||||||
@@ -124,7 +124,7 @@ pub enum SensorType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// 触摸动作
|
/// 触摸动作
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
pub enum TouchAction {
|
pub enum TouchAction {
|
||||||
/// 按下
|
/// 按下
|
||||||
Down,
|
Down,
|
||||||
@@ -135,7 +135,7 @@ pub enum TouchAction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// 设备能力
|
/// 设备能力
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
pub enum DeviceCapability {
|
pub enum DeviceCapability {
|
||||||
/// 显示屏
|
/// 显示屏
|
||||||
Display,
|
Display,
|
||||||
|
|||||||
Reference in New Issue
Block a user