diff --git a/ruma-client-api/src/r0/account/request_openid_token.rs b/ruma-client-api/src/r0/account/request_openid_token.rs index cc616355..2b3e19c4 100644 --- a/ruma-client-api/src/r0/account/request_openid_token.rs +++ b/ruma-client-api/src/r0/account/request_openid_token.rs @@ -61,7 +61,7 @@ impl Response { } /// Access token types. -#[derive(Clone, Debug, StringEnum)] +#[derive(Clone, Debug, PartialEq, Eq, StringEnum)] pub enum TokenType { /// Bearer token type Bearer, diff --git a/ruma-client-api/src/r0/membership/get_member_events.rs b/ruma-client-api/src/r0/membership/get_member_events.rs index ac43b408..4c4db436 100644 --- a/ruma-client-api/src/r0/membership/get_member_events.rs +++ b/ruma-client-api/src/r0/membership/get_member_events.rs @@ -63,7 +63,7 @@ impl Response { } /// The kind of membership events to filter for. -#[derive(Clone, Debug, StringEnum)] +#[derive(Clone, Debug, PartialEq, Eq, StringEnum)] #[ruma_enum(rename_all = "lowercase")] pub enum MembershipEventFilter { /// The user has joined. diff --git a/ruma-client-api/src/r0/push.rs b/ruma-client-api/src/r0/push.rs index 574ee21d..0b326ffa 100644 --- a/ruma-client-api/src/r0/push.rs +++ b/ruma-client-api/src/r0/push.rs @@ -70,7 +70,7 @@ pub struct Pusher { } /// Which kind a pusher is -#[derive(Clone, Debug, StringEnum)] +#[derive(Clone, Debug, PartialEq, Eq, StringEnum)] #[ruma_enum(rename_all = "snake_case")] pub enum PusherKind { /// A pusher that sends HTTP pokes. diff --git a/ruma-client-api/src/r0/room/create_room.rs b/ruma-client-api/src/r0/room/create_room.rs index 131463be..17a1bc08 100644 --- a/ruma-client-api/src/r0/room/create_room.rs +++ b/ruma-client-api/src/r0/room/create_room.rs @@ -160,7 +160,7 @@ impl Default for CreationContent { } /// A convenience parameter for setting a few default state events. -#[derive(Clone, Debug, StringEnum)] +#[derive(Clone, Debug, PartialEq, Eq, StringEnum)] #[ruma_enum(rename_all = "snake_case")] pub enum RoomPreset { /// `join_rules` is set to `invite` and `history_visibility` is set to `shared`. diff --git a/ruma-client-api/src/r0/search/search_events.rs b/ruma-client-api/src/r0/search/search_events.rs index 16187a96..3b2b648b 100644 --- a/ruma-client-api/src/r0/search/search_events.rs +++ b/ruma-client-api/src/r0/search/search_events.rs @@ -272,7 +272,7 @@ impl Groupings<'_> { } /// The keys to search for. -#[derive(Clone, Debug, StringEnum)] +#[derive(Clone, Debug, PartialEq, Eq, StringEnum)] pub enum SearchKeys { /// content.body #[ruma_enum(rename = "content.body")] @@ -291,7 +291,7 @@ pub enum SearchKeys { } /// The order in which to search for results. -#[derive(Clone, Debug, StringEnum)] +#[derive(Clone, Debug, PartialEq, Eq, StringEnum)] #[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)] #[ruma_enum(rename_all = "snake_case")] pub enum OrderBy { diff --git a/ruma-common/src/presence.rs b/ruma-common/src/presence.rs index 009441f6..9680dd57 100644 --- a/ruma-common/src/presence.rs +++ b/ruma-common/src/presence.rs @@ -5,7 +5,7 @@ use crate::StringEnum; /// A description of a user's connectivity and availability for chat. -#[derive(Clone, Debug, PartialEq, StringEnum)] +#[derive(Clone, Debug, PartialEq, Eq, StringEnum)] #[ruma_enum(rename_all = "snake_case")] pub enum PresenceState { /// Disconnected from the service. diff --git a/ruma-common/src/push.rs b/ruma-common/src/push.rs index f8c6b67c..67ad4afd 100644 --- a/ruma-common/src/push.rs +++ b/ruma-common/src/push.rs @@ -238,7 +238,7 @@ impl PusherData { /// Currently, only "event_id_only" is supported as of [Push Gateway API r0.1.1][spec]. /// /// [spec]: https://matrix.org/docs/spec/push_gateway/r0.1.1#homeserver-behaviour -#[derive(Clone, Debug, StringEnum)] +#[derive(Clone, Debug, PartialEq, Eq, StringEnum)] #[ruma_enum(rename_all = "snake_case")] pub enum PushFormat { /// Require the homeserver to only send a reduced set of fields in the push. diff --git a/ruma-events/src/call.rs b/ruma-events/src/call.rs index 8ce95bc9..dcb8c771 100644 --- a/ruma-events/src/call.rs +++ b/ruma-events/src/call.rs @@ -30,7 +30,7 @@ impl SessionDescription { } /// The type of VoIP session description. -#[derive(Clone, Debug, PartialEq, StringEnum)] +#[derive(Clone, Debug, PartialEq, Eq, StringEnum)] #[ruma_enum(rename_all = "snake_case")] pub enum SessionDescriptionType { /// An answer. diff --git a/ruma-events/src/call/hangup.rs b/ruma-events/src/call/hangup.rs index f93555b8..7067beba 100644 --- a/ruma-events/src/call/hangup.rs +++ b/ruma-events/src/call/hangup.rs @@ -31,7 +31,7 @@ pub struct HangupEventContent { /// This should not be provided when the user naturally ends or rejects the call. When there was an /// error in the call negotiation, this should be `ice_failed` for when ICE negotiation fails or /// `invite_timeout` for when the other party did not answer in time. -#[derive(Clone, Debug, PartialEq, StringEnum)] +#[derive(Clone, Debug, PartialEq, Eq, StringEnum)] #[ruma_enum(rename_all = "snake_case")] pub enum Reason { /// ICE negotiation failure. diff --git a/ruma-events/src/key/verification.rs b/ruma-events/src/key/verification.rs index b4decf27..7c4295c3 100644 --- a/ruma-events/src/key/verification.rs +++ b/ruma-events/src/key/verification.rs @@ -12,7 +12,7 @@ pub mod request; pub mod start; /// A hash algorithm. -#[derive(Clone, Debug, PartialEq, StringEnum)] +#[derive(Clone, Debug, PartialEq, Eq, StringEnum)] #[ruma_enum(rename_all = "snake_case")] pub enum HashAlgorithm { /// The SHA256 hash algorithm. @@ -23,7 +23,7 @@ pub enum HashAlgorithm { } /// A key agreement protocol. -#[derive(Clone, Debug, PartialEq, StringEnum)] +#[derive(Clone, Debug, PartialEq, Eq, StringEnum)] #[ruma_enum(rename_all = "kebab-case")] pub enum KeyAgreementProtocol { /// The [Curve25519](https://cr.yp.to/ecdh.html) key agreement protocol. @@ -37,7 +37,7 @@ pub enum KeyAgreementProtocol { } /// A message authentication code algorithm. -#[derive(Clone, Debug, PartialEq, StringEnum)] +#[derive(Clone, Debug, PartialEq, Eq, StringEnum)] #[ruma_enum(rename_all = "kebab-case")] pub enum MessageAuthenticationCode { /// The HKDF-HMAC-SHA256 MAC. @@ -51,7 +51,7 @@ pub enum MessageAuthenticationCode { } /// A Short Authentication String method. -#[derive(Clone, Debug, PartialEq, StringEnum)] +#[derive(Clone, Debug, PartialEq, Eq, StringEnum)] #[ruma_enum(rename_all = "snake_case")] pub enum ShortAuthenticationString { /// The decimal method. @@ -65,7 +65,7 @@ pub enum ShortAuthenticationString { } /// A Short Authentication String (SAS) verification method. -#[derive(Clone, Debug, PartialEq, StringEnum)] +#[derive(Clone, Debug, PartialEq, Eq, StringEnum)] pub enum VerificationMethod { /// The *m.sas.v1* verification method. #[ruma_enum(rename = "m.sas.v1")] diff --git a/ruma-events/src/key/verification/cancel.rs b/ruma-events/src/key/verification/cancel.rs index 0c2ba8fe..19a9eafc 100644 --- a/ruma-events/src/key/verification/cancel.rs +++ b/ruma-events/src/key/verification/cancel.rs @@ -35,7 +35,7 @@ pub struct CancelEventContent { /// available as a documented variant here, use its string representation, /// obtained through `.as_str()`. // FIXME: Add `m.foo_bar` as a naming scheme in StringEnum and remove rename attributes. -#[derive(Clone, Debug, PartialEq, StringEnum)] +#[derive(Clone, Debug, PartialEq, Eq, StringEnum)] pub enum CancelCode { /// The user cancelled the verification. #[ruma_enum(rename = "m.user")] diff --git a/ruma-events/src/policy/rule.rs b/ruma-events/src/policy/rule.rs index 8e63e952..7abe81d0 100644 --- a/ruma-events/src/policy/rule.rs +++ b/ruma-events/src/policy/rule.rs @@ -29,7 +29,7 @@ impl PolicyRuleEventContent { } /// Rules recommendations -#[derive(Clone, Debug, StringEnum)] +#[derive(Clone, Debug, PartialEq, Eq, StringEnum)] pub enum Recommendation { /// Entities affected by the rule should be banned from participation where possible. #[ruma_enum(rename = "m.ban")] diff --git a/ruma-events/src/room/guest_access.rs b/ruma-events/src/room/guest_access.rs index 09758a06..26ea5cea 100644 --- a/ruma-events/src/room/guest_access.rs +++ b/ruma-events/src/room/guest_access.rs @@ -29,7 +29,7 @@ impl GuestAccessEventContent { } /// A policy for guest user access to a room. -#[derive(Clone, Debug, PartialEq, StringEnum)] +#[derive(Clone, Debug, PartialEq, Eq, StringEnum)] #[ruma_enum(rename_all = "snake_case")] pub enum GuestAccess { /// Guests are allowed to join the room. diff --git a/ruma-events/src/room/history_visibility.rs b/ruma-events/src/room/history_visibility.rs index 1e410ff1..91026505 100644 --- a/ruma-events/src/room/history_visibility.rs +++ b/ruma-events/src/room/history_visibility.rs @@ -28,7 +28,7 @@ impl HistoryVisibilityEventContent { } /// Who can see a room's history. -#[derive(Clone, Debug, PartialEq, StringEnum)] +#[derive(Clone, Debug, PartialEq, Eq, StringEnum)] #[ruma_enum(rename_all = "snake_case")] pub enum HistoryVisibility { /// Previous events are accessible to newly joined members from the point they were invited diff --git a/ruma-events/src/room/join_rules.rs b/ruma-events/src/room/join_rules.rs index 6a725738..cf2f0b17 100644 --- a/ruma-events/src/room/join_rules.rs +++ b/ruma-events/src/room/join_rules.rs @@ -27,7 +27,7 @@ impl JoinRulesEventContent { } /// The rule used for users wishing to join this room. -#[derive(Clone, Debug, PartialEq, StringEnum)] +#[derive(Clone, Debug, PartialEq, Eq, StringEnum)] #[ruma_enum(rename_all = "lowercase")] pub enum JoinRule { /// A user who wishes to join the room must first receive an invite to the room from someone diff --git a/ruma-events/src/room/member.rs b/ruma-events/src/room/member.rs index 424927b9..e735e5c2 100644 --- a/ruma-events/src/room/member.rs +++ b/ruma-events/src/room/member.rs @@ -64,7 +64,7 @@ pub struct MemberEventContent { } /// The membership state of a user. -#[derive(Clone, Debug, PartialEq, StringEnum)] +#[derive(Clone, Debug, PartialEq, Eq, StringEnum)] #[ruma_enum(rename_all = "lowercase")] pub enum MembershipState { /// The user is banned. diff --git a/ruma-events/src/room/message.rs b/ruma-events/src/room/message.rs index 7144abcf..8dfc948e 100644 --- a/ruma-events/src/room/message.rs +++ b/ruma-events/src/room/message.rs @@ -287,7 +287,7 @@ pub struct ServerNoticeMessageEventContent { } /// Types of server notices. -#[derive(Clone, Debug, StringEnum)] +#[derive(Clone, Debug, PartialEq, Eq, StringEnum)] pub enum ServerNoticeType { /// The server has exceeded some limit which requires the server administrator to intervene. #[ruma_enum(rename = "m.server_notice.usage_limit_reached")] @@ -298,7 +298,7 @@ pub enum ServerNoticeType { } /// Types of usage limits. -#[derive(Clone, Debug, StringEnum)] +#[derive(Clone, Debug, PartialEq, Eq, StringEnum)] #[ruma_enum(rename_all = "snake_case")] pub enum LimitType { /// The server's number of active users in the last 30 days has exceeded the maximum. @@ -316,7 +316,7 @@ pub enum LimitType { /// This type can hold an arbitrary string. To check for events that are not /// available as a documented variant here, use its string representation, /// obtained through `.as_str()`. -#[derive(Clone, Debug, StringEnum)] +#[derive(Clone, Debug, PartialEq, Eq, StringEnum)] pub enum MessageFormat { /// HTML. #[ruma_enum(rename = "org.matrix.custom.html")] diff --git a/ruma-events/src/room/message/feedback.rs b/ruma-events/src/room/message/feedback.rs index a97b711f..8258fed4 100644 --- a/ruma-events/src/room/message/feedback.rs +++ b/ruma-events/src/room/message/feedback.rs @@ -34,7 +34,7 @@ impl FeedbackEventContent { } /// A type of feedback. -#[derive(Clone, Debug, PartialEq, StringEnum)] +#[derive(Clone, Debug, PartialEq, Eq, StringEnum)] #[ruma_enum(rename_all = "snake_case")] pub enum FeedbackType { /// Sent when a message is received. diff --git a/ruma-events/src/room_key_request.rs b/ruma-events/src/room_key_request.rs index a0c06eb1..b30fc8e7 100644 --- a/ruma-events/src/room_key_request.rs +++ b/ruma-events/src/room_key_request.rs @@ -35,7 +35,7 @@ pub struct RoomKeyRequestEventContent { } /// A new key request or a cancellation of a previous request. -#[derive(Clone, Debug, PartialEq, StringEnum)] +#[derive(Clone, Debug, PartialEq, Eq, StringEnum)] #[ruma_enum(rename_all = "snake_case")] pub enum Action { /// Request a key. diff --git a/ruma-push-gateway-api/src/send_event_notification/v1.rs b/ruma-push-gateway-api/src/send_event_notification/v1.rs index d644a9a1..693a2522 100644 --- a/ruma-push-gateway-api/src/send_event_notification/v1.rs +++ b/ruma-push-gateway-api/src/send_event_notification/v1.rs @@ -136,7 +136,7 @@ impl<'a> Notification<'a> { /// /// This may be used by push gateways to deliver less time-sensitive /// notifications in a way that will preserve battery power on mobile devices. -#[derive(Clone, Debug, PartialEq, StringEnum)] +#[derive(Clone, Debug, PartialEq, Eq, StringEnum)] #[ruma_enum(rename_all = "snake_case")] pub enum NotificationPriority { /// A high priority notification