use serde::{Deserialize, Serialize}; /*#[derive(Serialize, Deserialize, Debug, Clone)] pub struct LastMessage { id: String, user_id: String, short_content: String, } #[derive(Serialize, Deserialize, Debug, Clone)] pub struct Channel { #[serde(rename = "_id")] pub id: String, #[serde(rename = "type")] pub channel_type: u8, // DM: whether the DM is active pub active: Option, // DM + GDM: last message in channel pub last_message: Option, // DM + GDM: recipients for channel pub recipients: Option>, // GDM: owner of group pub owner: Option, // GUILD: channel parent pub guild: Option, // GUILD + GDM: channel name pub name: Option, // GUILD + GDM: channel description pub description: Option, }*/ #[derive(Serialize, Deserialize, Debug)] #[serde(tag = "type")] pub enum Channel { DirectMessage { #[serde(rename = "_id")] id: String, active: bool, recipients: Vec, }, Group { #[serde(rename = "_id")] id: String, name: String, owner: String, description: String, recipients: Vec, } }