mangadex_api_schema_rust/v5/statistics/
comments.rs1use serde::Deserialize;
2use url::Url;
3
4#[derive(Deserialize, Clone, Debug, Copy, Default)]
5#[non_exhaustive]
6#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
7#[serde(rename_all = "camelCase")]
8#[cfg_attr(feature = "specta", derive(specta::Type))]
9pub struct Comments {
10 pub thread_id: u32,
11 pub replies_count: u32,
12}
13
14impl TryInto<Url> for Comments {
15 type Error = url::ParseError;
16
17 fn try_into(self) -> Result<Url, Self::Error> {
18 Url::parse(format!("https://forums.mangadex.org/threads/{}", self.thread_id).as_str())
19 }
20}