rule34/types/
note_list.rs

1use std::num::NonZeroU64;
2use time::OffsetDateTime;
3
4/// A list of notes for posts
5#[derive(Debug, serde::Deserialize, serde::Serialize)]
6pub struct NoteList {
7    /// The list of notes
8    #[serde(rename = "note", default)]
9    pub notes: Box<[Note]>,
10}
11
12#[derive(Debug, serde::Deserialize, serde::Serialize)]
13pub struct Note {
14    /// The id of the note.
15    ///
16    /// Together with the version, this creates a unique id for the note.
17    #[serde(rename = "@id")]
18    pub id: u64,
19
20    /// The version of the note.
21    ///
22    /// Together with the id, this creates a unique id for the note.
23    #[serde(rename = "@version")]
24    pub version: NonZeroU64,
25
26    /// The time of the last update.
27    #[serde(rename = "@updated_at", with = "crate::util::asctime_with_offset")]
28    pub updated_at: OffsetDateTime,
29
30    /// ?
31    #[serde(rename = "@is_active")]
32    pub is_active: bool,
33
34    /// The time of the creation.
35    #[serde(rename = "@created_at", with = "crate::util::asctime_with_offset")]
36    pub created_at: OffsetDateTime,
37
38    /// The x position.
39    #[serde(rename = "@x")]
40    pub x: u64,
41
42    /// The y position
43    #[serde(rename = "@y")]
44    pub y: u64,
45
46    /// The width
47    #[serde(rename = "@width")]
48    pub width: u64,
49
50    /// The height
51    #[serde(rename = "@height")]
52    pub height: u64,
53
54    /// The note body
55    #[serde(rename = "@body")]
56    pub body: Box<str>,
57
58    /// The creator
59    #[serde(rename = "@creator_id")]
60    pub creator_id: NonZeroU64,
61}