Skip to content

Commit

Permalink
pixiv: allow models to be serialized
Browse files Browse the repository at this point in the history
  • Loading branch information
karin0 committed Sep 16, 2024
1 parent 058a9b7 commit 95de9c5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pixiv/src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@ pub fn from_response<'de, T: Deserialize<'de>>(resp: Response) -> Result<T, serd
T::deserialize(MapDeserializer::new(resp.into_iter()))
}

#[derive(Debug, Deserialize, Clone)]
#[derive(Debug, Deserialize, Serialize, Clone)]
pub struct ImageUrls {
pub original: String,
}

#[derive(Debug, Deserialize, Clone)]
#[derive(Debug, Deserialize, Serialize, Clone)]
pub struct MetaPage {
pub image_urls: ImageUrls,
}

#[derive(Debug, Deserialize, Clone)]
#[derive(Debug, Deserialize, Serialize, Clone)]
pub struct MetaSinglePage {
pub original_image_url: Option<String>,
}

#[derive(Debug, Deserialize, Clone)]
#[derive(Debug, Deserialize, Serialize, Clone)]
pub struct Tag {
pub name: String,
}
Expand All @@ -41,7 +41,7 @@ pub struct User {
pub account: String,
}

#[derive(Debug, Deserialize, Clone)]
#[derive(Debug, Deserialize, Serialize, Clone)]
pub struct Illust {
pub id: IllustId,
pub title: String,
Expand All @@ -62,7 +62,7 @@ pub struct Illust {
pub type_: String,
}

#[derive(Deserialize, Debug, Clone)]
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct IllustPage {
pub illusts: Vec<Illust>,
pub next_url: Option<String>,
Expand Down

0 comments on commit 95de9c5

Please sign in to comment.