revolt_models/v0/
channel_unreads.rs

1auto_derived!(
2    /// Channel Unread
3    pub struct ChannelUnread {
4        /// Composite key pointing to a user's view of a channel
5        #[serde(rename = "_id")]
6        pub id: ChannelCompositeKey,
7
8        /// Id of the last message read in this channel by a user
9        #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
10        pub last_id: Option<String>,
11        /// Array of message ids that mention the user
12        #[cfg_attr(
13            feature = "serde",
14            serde(skip_serializing_if = "Vec::is_empty", default)
15        )]
16        pub mentions: Vec<String>,
17    }
18
19    /// Composite primary key consisting of channel and user id
20    #[derive(Hash)]
21    pub struct ChannelCompositeKey {
22        /// Channel Id
23        pub channel: String,
24        /// User Id
25        pub user: String,
26    }
27);