blob: 6aa3ee8cff21c6f96afa32f925538b311f23a0a9 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
use time::OffsetDateTime;
use crate::error::Error;
use crate::Result;
#[derive(sqlx::FromRow)]
pub struct Comment {
/// id of the comment in the thread
comment_id: Option<i32>,
/// text of the comment
pub text: String,
/// id of artwork thread comment is in
pub artwork_id: i32,
/// comment creation time
created_at: Option<OffsetDateTime>,
/// comments that are mentioned by the comment
pub in_reply_to_ids: Vec<i32>,
/// comments that mention the comment
mentioned_by_ids: Vec<i32>,
}
impl Comment {
pub fn id(&self) -> Option<i32> {
self.comment_id
}
pub fn created_at(&self) -> Option<OffsetDateTime> {
self.created_at
}
pub fn mentioned_by_ids(&self) -> &Vec<i32> {
&self.mentioned_by_ids
}
}
|