use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Debug, Clone)] pub enum RelationshipStatus { None, User, Friend, Outgoing, Incoming, Blocked, BlockedOther, } #[derive(Serialize, Deserialize, Debug)] pub struct Relationship { #[serde(rename = "_id")] pub id: String, pub status: RelationshipStatus, } #[derive(Serialize, Deserialize, Debug)] pub struct User { #[serde(rename = "_id")] pub id: String, pub username: String, #[serde(skip_serializing_if = "Option::is_none")] pub relations: Option<Vec<Relationship>>, // ? This should never be pushed to the collection. #[serde(skip_serializing_if = "Option::is_none")] pub relationship: Option<RelationshipStatus>, }