diff --git a/jarust_plugins/src/audio_bridge/common.rs b/jarust_plugins/src/audio_bridge/common.rs index b6be7b2..4761226 100644 --- a/jarust_plugins/src/audio_bridge/common.rs +++ b/jarust_plugins/src/audio_bridge/common.rs @@ -4,7 +4,7 @@ use serde::Serialize; /// Rooms and Participants Identifier. /// /// Identifier should be by default unsigned integer, unless configured otherwise in the audiobridge config. -#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)] +#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Serialize, Deserialize)] #[serde(untagged)] pub enum Identifier { /// String Identifier @@ -13,7 +13,7 @@ pub enum Identifier { Uint(u64), } -#[derive(PartialEq, Debug, Deserialize)] +#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Deserialize)] pub struct Participant { pub id: Identifier, pub display: Option, diff --git a/jarust_plugins/src/audio_bridge/events.rs b/jarust_plugins/src/audio_bridge/events.rs index 696d834..57c208a 100644 --- a/jarust_plugins/src/audio_bridge/events.rs +++ b/jarust_plugins/src/audio_bridge/events.rs @@ -9,7 +9,7 @@ use jarust::japrotocol::ResponseType; use serde::Deserialize; use serde_json::from_value; -#[derive(Debug, PartialEq, Deserialize)] +#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Deserialize)] #[serde(tag = "audiobridge")] enum AudioBridgeEventDto { #[serde(rename = "joined")] @@ -36,13 +36,13 @@ enum AudioBridgeEventDto { }, } -#[derive(Debug, PartialEq)] +#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)] pub enum PluginEvent { AudioBridgeEvent(AudioBridgeEvent), GenericEvent(GenericEvent), } -#[derive(Debug, PartialEq)] +#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)] pub enum AudioBridgeEvent { RoomJoinedWithEstabilshment { id: Identifier, diff --git a/jarust_plugins/src/audio_bridge/msg_opitons.rs b/jarust_plugins/src/audio_bridge/msg_opitons.rs index e8bc6bf..e99ce00 100644 --- a/jarust_plugins/src/audio_bridge/msg_opitons.rs +++ b/jarust_plugins/src/audio_bridge/msg_opitons.rs @@ -1,7 +1,7 @@ use super::common::Identifier; use serde::Serialize; -#[derive(Serialize, Default)] +#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Default, Serialize)] pub struct CreateRoomOptions { /// unique numeric ID, chosen by plugin if missing #[serde(skip_serializing_if = "Option::is_none")] @@ -95,7 +95,7 @@ pub struct CreateRoomOptions { pub groups: Option>, } -#[derive(Serialize, Default)] +#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Default, Serialize)] pub struct EditRoomOptions { /// room secret, mandatory if configured #[serde(skip_serializing_if = "Option::is_none")] @@ -130,7 +130,7 @@ pub struct EditRoomOptions { pub permanent: Option, } -#[derive(Serialize, Default)] +#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Default, Serialize)] pub struct DestroyRoomMsg { #[serde(skip_serializing_if = "Option::is_none")] pub secret: Option, @@ -138,7 +138,7 @@ pub struct DestroyRoomMsg { pub permanent: Option, } -#[derive(Serialize, Default)] +#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Default, Serialize)] pub struct JoinRoomOptions { /// Unique ID to assign to the participant, assigned by the plugin if missing #[serde(skip_serializing_if = "Option::is_none")] @@ -236,7 +236,7 @@ pub struct JoinRoomOptions { pub generate_offer: Option, } -#[derive(Serialize)] +#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Serialize)] pub struct AllowedOptions { pub action: AllowAction, @@ -248,7 +248,7 @@ pub struct AllowedOptions { pub secret: Option, } -#[derive(Serialize)] +#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Serialize)] #[serde(rename_all = "lowercase")] pub enum AllowAction { Enable, diff --git a/jarust_plugins/src/audio_bridge/responses.rs b/jarust_plugins/src/audio_bridge/responses.rs index 4729497..ee27239 100644 --- a/jarust_plugins/src/audio_bridge/responses.rs +++ b/jarust_plugins/src/audio_bridge/responses.rs @@ -2,30 +2,30 @@ use super::common::Identifier; use super::common::Participant; use serde::Deserialize; -#[derive(Debug, Deserialize)] +#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Deserialize)] pub struct RoomCreatedRsp { pub room: Identifier, pub permanent: bool, } -#[derive(Debug, Deserialize)] +#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Deserialize)] pub struct RoomEditedRsp { pub room: Identifier, pub permanent: bool, } -#[derive(Debug, Deserialize)] +#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Deserialize)] pub struct RoomDestroyedRsp { pub room: Identifier, pub permanent: bool, } -#[derive(Debug, Deserialize)] +#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Deserialize)] pub struct ListRoomsRsp { pub list: Vec, } -#[derive(Debug, Deserialize)] +#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Deserialize)] pub struct Room { pub room: Identifier, pub description: String, @@ -37,19 +37,19 @@ pub struct Room { pub muted: bool, } -#[derive(Debug, Deserialize)] +#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Deserialize)] pub struct AllowedRsp { pub room: Identifier, pub allowed: Vec, } -#[derive(Debug, Deserialize)] +#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Deserialize)] pub struct ExistsRoomRsp { pub room: Identifier, pub exists: bool, } -#[derive(Debug, Deserialize)] +#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Deserialize)] pub struct ListParticipantsRsp { pub room: Identifier, pub participants: Vec, diff --git a/jarust_plugins/src/echo_test/events.rs b/jarust_plugins/src/echo_test/events.rs index c9d781a..15e3cce 100644 --- a/jarust_plugins/src/echo_test/events.rs +++ b/jarust_plugins/src/echo_test/events.rs @@ -7,19 +7,19 @@ use jarust::japrotocol::ResponseType; use serde::Deserialize; use serde_json::from_value; -#[derive(Debug, Deserialize, Clone)] +#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Deserialize)] enum EchoTestEventDto { #[serde(untagged)] Result { echotest: String, result: String }, } -#[derive(Debug, PartialEq)] +#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)] pub enum PluginEvent { EchoTestEvent(EchoTestEvent), GenericEvent(GenericEvent), } -#[derive(Debug, PartialEq)] +#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)] pub enum EchoTestEvent { Result { echotest: String, diff --git a/jarust_plugins/src/echo_test/msg_options.rs b/jarust_plugins/src/echo_test/msg_options.rs index e484106..8e08db9 100644 --- a/jarust_plugins/src/echo_test/msg_options.rs +++ b/jarust_plugins/src/echo_test/msg_options.rs @@ -1,6 +1,6 @@ use serde::Serialize; -#[derive(Serialize, Default)] +#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Default, Serialize)] pub struct StartOptions { pub audio: bool, pub video: bool, diff --git a/jarust_plugins/src/video_room/events.rs b/jarust_plugins/src/video_room/events.rs index 5cc5653..a5cf3cc 100644 --- a/jarust_plugins/src/video_room/events.rs +++ b/jarust_plugins/src/video_room/events.rs @@ -2,7 +2,7 @@ use jarust::error::JaError; use jarust::japrotocol::GenericEvent; use jarust::japrotocol::JaResponse; -#[derive(Debug, PartialEq)] +#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)] pub enum PluginEvent { GenericEvent(GenericEvent), }