post_archiver/
comment.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
use serde::{Deserialize, Serialize};
#[cfg(feature = "typescript")]
use ts_rs::TS;

#[cfg_attr(feature = "typescript", derive(TS))]
#[cfg_attr(feature = "typescript", ts(export))]
#[derive(Deserialize, Serialize, Debug, Clone, Hash)]
pub struct Comment {
    pub user: String,
    pub text: String,
    #[cfg_attr(feature = "typescript", ts(as = "Option<Vec<Comment>>", optional))]
    #[serde(skip_serializing_if = "<[_]>::is_empty")]
    pub replies: Vec<Comment>,
}