Derive Clone for basically everything. Close #3."

This commit is contained in:
Jimmy Cuadra 2016-10-16 16:20:21 -07:00
parent e6c0dd4bdc
commit f57a1aec48
27 changed files with 54 additions and 53 deletions

View File

@ -8,7 +8,7 @@ room_event! {
} }
/// The payload of an `AnswerEvent`. /// The payload of an `AnswerEvent`.
#[derive(Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct AnswerEventContent { pub struct AnswerEventContent {
/// The VoIP session description. /// The VoIP session description.
pub answer: SessionDescription, pub answer: SessionDescription,

View File

@ -8,7 +8,7 @@ room_event! {
} }
/// The payload of a `CandidatesEvent`. /// The payload of a `CandidatesEvent`.
#[derive(Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct CandidatesEventContent { pub struct CandidatesEventContent {
/// The ID of the call this event relates to. /// The ID of the call this event relates to.
pub call_id: String, pub call_id: String,
@ -19,7 +19,7 @@ pub struct CandidatesEventContent {
} }
/// An ICE (Interactive Connectivity Establishment) candidate. /// An ICE (Interactive Connectivity Establishment) candidate.
#[derive(Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct Candidate { pub struct Candidate {
/// The SDP "a" line of the candidate. /// The SDP "a" line of the candidate.
pub candidate: String, pub candidate: String,

View File

@ -7,7 +7,7 @@ room_event! {
} }
/// The payload of a `HangupEvent`. /// The payload of a `HangupEvent`.
#[derive(Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct HangupEventContent { pub struct HangupEventContent {
/// The ID of the call this event relates to. /// The ID of the call this event relates to.
pub call_id: String, pub call_id: String,

View File

@ -8,7 +8,7 @@ room_event! {
} }
/// The payload of an `InviteEvent`. /// The payload of an `InviteEvent`.
#[derive(Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct InviteEventContent { pub struct InviteEventContent {
/// A unique identifer for the call. /// A unique identifer for the call.
pub call_id: String, pub call_id: String,

View File

@ -8,7 +8,7 @@ pub mod hangup;
pub mod invite; pub mod invite;
/// A VoIP session description. /// A VoIP session description.
#[derive(Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct SessionDescription { pub struct SessionDescription {
/// The type of session description. /// The type of session description.
pub session_type: SessionDescriptionType, pub session_type: SessionDescriptionType,
@ -17,7 +17,7 @@ pub struct SessionDescription {
} }
/// The type of VoIP session description. /// The type of VoIP session description.
#[derive(Debug, Deserialize, PartialEq, Serialize)] #[derive(Clone, Copy, Debug, Deserialize, PartialEq, Serialize)]
pub enum SessionDescriptionType { pub enum SessionDescriptionType {
/// An answer. /// An answer.
#[serde(rename="answer")] #[serde(rename="answer")]

View File

@ -27,6 +27,7 @@ pub mod tag;
pub mod typing; pub mod typing;
/// An error when attempting to convert a string to an enum that only accepts certain values. /// An error when attempting to convert a string to an enum that only accepts certain values.
#[derive(Clone, Copy, Debug)]
pub struct ParseError; pub struct ParseError;
/// The type of an event. /// The type of an event.

View File

@ -33,7 +33,7 @@ macro_rules! event {
} }
) => { ) => {
$(#[$attr])* $(#[$attr])*
#[derive(Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct $name { pub struct $name {
/// The event's content. /// The event's content.
pub content: $content_type, pub content: $content_type,
@ -78,7 +78,7 @@ macro_rules! room_event {
} }
) => { ) => {
$(#[$attr])* $(#[$attr])*
#[derive(Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct $name { pub struct $name {
/// The event's content. /// The event's content.
pub content: $content_type, pub content: $content_type,
@ -146,7 +146,7 @@ macro_rules! state_event {
) => { ) => {
$(#[$attr])* $(#[$attr])*
#[allow(missing_docs)] #[allow(missing_docs)]
#[derive(Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct $name { pub struct $name {
/// The event's content. /// The event's content.
pub content: $content_type, pub content: $content_type,

View File

@ -11,7 +11,7 @@ event! {
} }
/// The payload of a `PresenceEvent`. /// The payload of a `PresenceEvent`.
#[derive(Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct PresenceEventContent { pub struct PresenceEventContent {
/// The current avatar URL for this user. /// The current avatar URL for this user.
#[serde(skip_serializing_if="Option::is_none")] #[serde(skip_serializing_if="Option::is_none")]
@ -36,7 +36,7 @@ pub struct PresenceEventContent {
} }
/// A description of a user's connectivity and availability for chat. /// A description of a user's connectivity and availability for chat.
#[derive(Debug, Deserialize, PartialEq, Serialize)] #[derive(Clone, Copy, Debug, Deserialize, PartialEq, Serialize)]
pub enum PresenceState { pub enum PresenceState {
/// Disconnected from the service. /// Disconnected from the service.
#[serde(rename="offline")] #[serde(rename="offline")]

View File

@ -19,7 +19,7 @@ event! {
pub type ReceiptEventContent = HashMap<EventId, Receipts>; pub type ReceiptEventContent = HashMap<EventId, Receipts>;
/// A collection of receipts. /// A collection of receipts.
#[derive(Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct Receipts { pub struct Receipts {
/// A collection of users who have sent *m.read* receipts for this event. /// A collection of users who have sent *m.read* receipts for this event.
pub m_read: UserReceipts, pub m_read: UserReceipts,
@ -31,7 +31,7 @@ pub struct Receipts {
pub type UserReceipts = HashMap<UserId, Receipt>; pub type UserReceipts = HashMap<UserId, Receipt>;
/// An acknowledgement of an event. /// An acknowledgement of an event.
#[derive(Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct Receipt { pub struct Receipt {
/// The timestamp the receipt was sent at. /// The timestamp the receipt was sent at.
pub ts: u64, pub ts: u64,

View File

@ -8,7 +8,7 @@ state_event! {
} }
/// The payload of an `AliasesEvent`. /// The payload of an `AliasesEvent`.
#[derive(Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct AliasesEventContent { pub struct AliasesEventContent {
/// A list of room aliases. /// A list of room aliases.
pub aliases: Vec<RoomAliasId>, pub aliases: Vec<RoomAliasId>,

View File

@ -10,7 +10,7 @@ state_event! {
} }
/// The payload of an `AvatarEvent`. /// The payload of an `AvatarEvent`.
#[derive(Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct AvatarEventContent { pub struct AvatarEventContent {
/// Information about the avatar image. /// Information about the avatar image.
pub info: ImageInfo, pub info: ImageInfo,

View File

@ -8,7 +8,7 @@ state_event! {
} }
/// The payload of a `CanonicalAliasEvent`. /// The payload of a `CanonicalAliasEvent`.
#[derive(Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct CanonicalAliasEventContent { pub struct CanonicalAliasEventContent {
/// The canonical alias. /// The canonical alias.
pub alias: RoomAliasId, pub alias: RoomAliasId,

View File

@ -9,7 +9,7 @@ state_event! {
} }
/// The payload of a `CreateEvent`. /// The payload of a `CreateEvent`.
#[derive(Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct CreateEventContent { pub struct CreateEventContent {
/// The `user_id` of the room creator. This is set by the homeserver. /// The `user_id` of the room creator. This is set by the homeserver.
pub creator: UserId, pub creator: UserId,

View File

@ -9,14 +9,14 @@ state_event! {
} }
/// The payload of a `GuestAccessEvent`. /// The payload of a `GuestAccessEvent`.
#[derive(Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct GuestAccessEventContent { pub struct GuestAccessEventContent {
/// A policy for guest user access to a room. /// A policy for guest user access to a room.
pub guest_access: GuestAccess, pub guest_access: GuestAccess,
} }
/// A policy for guest user access to a room. /// A policy for guest user access to a room.
#[derive(Debug, Deserialize, PartialEq, Serialize)] #[derive(Clone, Copy, Debug, Deserialize, PartialEq, Serialize)]
pub enum GuestAccess { pub enum GuestAccess {
/// Guests are allowed to join the room. /// Guests are allowed to join the room.
#[serde(rename="can_join")] #[serde(rename="can_join")]

View File

@ -7,14 +7,14 @@ state_event! {
} }
/// The payload of a `HistoryVisibilityEvent`. /// The payload of a `HistoryVisibilityEvent`.
#[derive(Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct HistoryVisibilityEventContent { pub struct HistoryVisibilityEventContent {
/// Who can see the room history. /// Who can see the room history.
pub history_visibility: HistoryVisibility, pub history_visibility: HistoryVisibility,
} }
/// Who can see a room's history. /// Who can see a room's history.
#[derive(Debug, Deserialize, PartialEq, Serialize)] #[derive(Clone, Copy, Debug, Deserialize, PartialEq, Serialize)]
pub enum HistoryVisibility { pub enum HistoryVisibility {
/// Previous events are accessible to newly joined members from the point they were invited /// Previous events are accessible to newly joined members from the point they were invited
/// onwards. Events stop being accessible when the member's state changes to something other /// onwards. Events stop being accessible when the member's state changes to something other

View File

@ -6,14 +6,14 @@ state_event! {
} }
/// The payload of a `JoinRulesEvent`. /// The payload of a `JoinRulesEvent`.
#[derive(Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct JoinRulesEventContent { pub struct JoinRulesEventContent {
/// The type of rules used for users wishing to join this room. /// The type of rules used for users wishing to join this room.
pub join_rule: JoinRule, pub join_rule: JoinRule,
} }
/// The rule used for users wishing to join this room. /// The rule used for users wishing to join this room.
#[derive(Debug, Deserialize, PartialEq, Serialize)] #[derive(Clone, Copy, Debug, Deserialize, PartialEq, Serialize)]
pub enum JoinRule { pub enum JoinRule {
/// A user who wishes to join the room must first receive an invite to the room from someone /// A user who wishes to join the room must first receive an invite to the room from someone
/// already inside of the room. /// already inside of the room.

View File

@ -27,7 +27,7 @@ state_event! {
} }
/// The payload of a `MemberEvent`. /// The payload of a `MemberEvent`.
#[derive(Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct MemberEventContent { pub struct MemberEventContent {
/// The avatar URL for this user. /// The avatar URL for this user.
#[serde(skip_serializing_if="Option::is_none")] #[serde(skip_serializing_if="Option::is_none")]
@ -47,7 +47,7 @@ pub struct MemberEventContent {
} }
/// The membership state of a user. /// The membership state of a user.
#[derive(Debug, Deserialize, PartialEq, Serialize)] #[derive(Clone, Copy, Debug, Deserialize, PartialEq, Serialize)]
pub enum MembershipState { pub enum MembershipState {
/// The user is banned. /// The user is banned.
#[serde(rename="ban")] #[serde(rename="ban")]
@ -81,7 +81,7 @@ impl_enum! {
} }
/// Information about a third party invitation. /// Information about a third party invitation.
#[derive(Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct ThirdPartyInvite { pub struct ThirdPartyInvite {
/// A name which can be displayed to represent the user instead of their third party /// A name which can be displayed to represent the user instead of their third party
/// identifier. /// identifier.
@ -93,7 +93,7 @@ pub struct ThirdPartyInvite {
/// A block of content which has been signed, which servers can use to verify a third party /// A block of content which has been signed, which servers can use to verify a third party
/// invitation. /// invitation.
#[derive(Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct SignedContent { pub struct SignedContent {
/// The invited Matrix user ID. /// The invited Matrix user ID.
/// ///

View File

@ -11,7 +11,7 @@ room_event! {
} }
/// The message type of message event, e.g. `m.image` or `m.text`. /// The message type of message event, e.g. `m.image` or `m.text`.
#[derive(Debug, Deserialize, PartialEq, Serialize)] #[derive(Clone, Copy, Debug, Deserialize, PartialEq, Serialize)]
pub enum MessageType { pub enum MessageType {
/// An audio message. /// An audio message.
#[serde(rename="m.audio")] #[serde(rename="m.audio")]
@ -47,7 +47,7 @@ pub enum MessageType {
} }
/// The payload of a message event. /// The payload of a message event.
#[derive(Debug, PartialEq)] #[derive(Clone, Debug, PartialEq)]
pub enum MessageEventContent { pub enum MessageEventContent {
/// An audio message. /// An audio message.
Audio(AudioMessageEventContent), Audio(AudioMessageEventContent),
@ -75,7 +75,7 @@ pub enum MessageEventContent {
} }
/// The payload of an audio message. /// The payload of an audio message.
#[derive(Debug, Deserialize, PartialEq, Serialize)] #[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
pub struct AudioMessageEventContent { pub struct AudioMessageEventContent {
/// The textual representation of this message. /// The textual representation of this message.
pub body: String, pub body: String,
@ -89,7 +89,7 @@ pub struct AudioMessageEventContent {
} }
/// Metadata about an audio clip. /// Metadata about an audio clip.
#[derive(Debug, Deserialize, PartialEq, Serialize)] #[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
pub struct AudioInfo { pub struct AudioInfo {
/// The duration of the audio in milliseconds. /// The duration of the audio in milliseconds.
#[serde(skip_serializing_if="Option::is_none")] #[serde(skip_serializing_if="Option::is_none")]
@ -103,7 +103,7 @@ pub struct AudioInfo {
} }
/// The payload of an emote message. /// The payload of an emote message.
#[derive(Debug, Deserialize, PartialEq, Serialize)] #[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
pub struct EmoteMessageEventContent { pub struct EmoteMessageEventContent {
/// The emote action to perform. /// The emote action to perform.
pub body: String, pub body: String,
@ -112,7 +112,7 @@ pub struct EmoteMessageEventContent {
} }
/// The payload of a file message. /// The payload of a file message.
#[derive(Debug, Deserialize, PartialEq, Serialize)] #[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
pub struct FileMessageEventContent { pub struct FileMessageEventContent {
/// A human-readable description of the file. This is recommended to be the filename of the /// A human-readable description of the file. This is recommended to be the filename of the
/// original upload. /// original upload.
@ -133,7 +133,7 @@ pub struct FileMessageEventContent {
} }
/// Metadata about a file. /// Metadata about a file.
#[derive(Debug, Deserialize, PartialEq, Serialize)] #[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
pub struct FileInfo { pub struct FileInfo {
/// The mimetype of the file, e.g. "application/msword." /// The mimetype of the file, e.g. "application/msword."
pub mimetype: String, pub mimetype: String,
@ -142,7 +142,7 @@ pub struct FileInfo {
} }
/// The payload of an image message. /// The payload of an image message.
#[derive(Debug, Deserialize, PartialEq, Serialize)] #[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
pub struct ImageMessageEventContent { pub struct ImageMessageEventContent {
/// A textual representation of the image. This could be the alt text of the image, the filename /// A textual representation of the image. This could be the alt text of the image, the filename
/// of the image, or some kind of content description for accessibility e.g. "image attachment." /// of the image, or some kind of content description for accessibility e.g. "image attachment."
@ -163,7 +163,7 @@ pub struct ImageMessageEventContent {
} }
/// The payload of a location message. /// The payload of a location message.
#[derive(Debug, Deserialize, PartialEq, Serialize)] #[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
pub struct LocationMessageEventContent { pub struct LocationMessageEventContent {
/// A description of the location e.g. "Big Ben, London, UK,"or some kind of content description /// A description of the location e.g. "Big Ben, London, UK,"or some kind of content description
/// for accessibility, e.g. "location attachment." /// for accessibility, e.g. "location attachment."
@ -181,7 +181,7 @@ pub struct LocationMessageEventContent {
} }
/// The payload of a notice message. /// The payload of a notice message.
#[derive(Debug, Deserialize, PartialEq, Serialize)] #[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
pub struct NoticeMessageEventContent { pub struct NoticeMessageEventContent {
/// The notice text to send. /// The notice text to send.
pub body: String, pub body: String,
@ -190,7 +190,7 @@ pub struct NoticeMessageEventContent {
} }
/// The payload of a text message. /// The payload of a text message.
#[derive(Debug, Deserialize, PartialEq, Serialize)] #[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
pub struct TextMessageEventContent { pub struct TextMessageEventContent {
/// The body of the message. /// The body of the message.
pub body: String, pub body: String,
@ -199,7 +199,7 @@ pub struct TextMessageEventContent {
} }
/// The payload of a video message. /// The payload of a video message.
#[derive(Debug, Deserialize, PartialEq, Serialize)] #[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
pub struct VideoMessageEventContent { pub struct VideoMessageEventContent {
/// A description of the video, e.g. "Gangnam Style," or some kind of content description for /// A description of the video, e.g. "Gangnam Style," or some kind of content description for
/// accessibility, e.g. "video attachment." /// accessibility, e.g. "video attachment."
@ -214,7 +214,7 @@ pub struct VideoMessageEventContent {
} }
/// Metadata about a video. /// Metadata about a video.
#[derive(Debug, Deserialize, PartialEq, Serialize)] #[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
pub struct VideoInfo { pub struct VideoInfo {
/// The duration of the video in milliseconds. /// The duration of the video in milliseconds.
#[serde(skip_serializing_if="Option::is_none")] #[serde(skip_serializing_if="Option::is_none")]

View File

@ -18,7 +18,7 @@ pub mod third_party_invite;
pub mod topic; pub mod topic;
/// Metadata about an image. /// Metadata about an image.
#[derive(Debug, Deserialize, PartialEq, Serialize)] #[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
pub struct ImageInfo { pub struct ImageInfo {
/// The height of the image in pixels. /// The height of the image in pixels.
pub height: u64, pub height: u64,

View File

@ -6,7 +6,7 @@ state_event! {
} }
/// The payload of a `NameEvent`. /// The payload of a `NameEvent`.
#[derive(Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct NameEventContent { pub struct NameEventContent {
/// The name of the room. This MUST NOT exceed 255 bytes. /// The name of the room. This MUST NOT exceed 255 bytes.
pub name: String, pub name: String,

View File

@ -12,7 +12,7 @@ state_event! {
} }
/// The payload of a `PowerLevelsEvent`. /// The payload of a `PowerLevelsEvent`.
#[derive(Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct PowerLevelsEventContent { pub struct PowerLevelsEventContent {
/// The level required to ban a user. /// The level required to ban a user.
pub ban: u64, pub ban: u64,

View File

@ -11,7 +11,7 @@ room_event! {
} }
/// The payload of a `RedactionEvent`. /// The payload of a `RedactionEvent`.
#[derive(Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct RedactionEventContent { pub struct RedactionEventContent {
/// The reason for the redaction, if any. /// The reason for the redaction, if any.
#[serde(skip_serializing_if="Option::is_none")] #[serde(skip_serializing_if="Option::is_none")]

View File

@ -10,7 +10,7 @@ state_event! {
} }
/// The payload of a `ThirdPartyInviteEvent`. /// The payload of a `ThirdPartyInviteEvent`.
#[derive(Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct ThirdPartyInviteEventContent { pub struct ThirdPartyInviteEventContent {
/// A user-readable string which represents the user who has been invited. /// A user-readable string which represents the user who has been invited.
pub display_name: String, pub display_name: String,
@ -27,7 +27,7 @@ pub struct ThirdPartyInviteEventContent {
} }
/// A public key for signing a third party invite token. /// A public key for signing a third party invite token.
#[derive(Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct PublicKey { pub struct PublicKey {
/// An optional URL which can be fetched to validate whether the key has been revoked. /// An optional URL which can be fetched to validate whether the key has been revoked.
/// ///

View File

@ -6,7 +6,7 @@ state_event! {
} }
/// The payload of a `TopicEvent`. /// The payload of a `TopicEvent`.
#[derive(Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct TopicEventContent { pub struct TopicEventContent {
/// The topic text. /// The topic text.
pub topic: String, pub topic: String,

View File

@ -9,7 +9,7 @@ use room::join_rules::JoinRulesEventContent;
use room::name::NameEventContent; use room::name::NameEventContent;
/// A stripped-down version of a state event that is included along with some other events. /// A stripped-down version of a state event that is included along with some other events.
#[derive(Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub enum StrippedState { pub enum StrippedState {
/// A stripped-down version of the *m.room.avatar* event. /// A stripped-down version of the *m.room.avatar* event.
RoomAvatar(StrippedRoomAvatar), RoomAvatar(StrippedRoomAvatar),
@ -25,7 +25,7 @@ pub enum StrippedState {
} }
/// The general form of a `StrippedState`. /// The general form of a `StrippedState`.
#[derive(Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct StrippedStateContent<C> where C: Deserialize + Serialize { pub struct StrippedStateContent<C> where C: Deserialize + Serialize {
/// Data specific to the event type. /// Data specific to the event type.
pub content: C, pub content: C,

View File

@ -8,14 +8,14 @@ event! {
} }
/// The payload of a `TagEvent`. /// The payload of a `TagEvent`.
#[derive(Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct TagEventContent { pub struct TagEventContent {
/// A map of tag names to tag info. /// A map of tag names to tag info.
pub tags: HashMap<String, TagInfo>, pub tags: HashMap<String, TagInfo>,
} }
/// Information about a tag. /// Information about a tag.
#[derive(Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct TagInfo { pub struct TagInfo {
/// Value to use for lexicographically ordering rooms with this tag. /// Value to use for lexicographically ordering rooms with this tag.
#[serde(skip_serializing_if="Option::is_none")] #[serde(skip_serializing_if="Option::is_none")]

View File

@ -11,7 +11,7 @@ event! {
} }
/// The payload of a `TypingEvent`. /// The payload of a `TypingEvent`.
#[derive(Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct TypingEventContent { pub struct TypingEventContent {
/// The list of user IDs typing in this room, if any. /// The list of user IDs typing in this room, if any.
pub user_ids: Vec<EventId>, pub user_ids: Vec<EventId>,