nhentairs/src/structs.rs

52 lines
1.1 KiB
Rust
Raw Normal View History

2020-09-12 12:26:07 +00:00
use serde::Deserialize;
#[derive(Deserialize, Debug)]
pub struct GalleryTitleInfo {
2020-10-26 11:28:39 +00:00
pub english: Option<String>,
pub japanese: Option<String>,
pub pretty: Option<String>,
2020-09-12 12:26:07 +00:00
}
#[derive(Deserialize, Debug)]
pub struct GalleryImageInfo {
pub t: String,
pub w: usize,
pub h: usize
}
#[derive(Deserialize, Debug)]
pub struct GalleryImagesInfo {
pub pages: Vec<GalleryImageInfo>,
2020-10-26 11:28:39 +00:00
pub cover: GalleryImageInfo,
2020-09-12 12:26:07 +00:00
pub thumbnail: GalleryImageInfo
}
#[derive(Deserialize, Debug)]
pub struct GalleryTagInfo {
pub id: usize,
pub r#type: String,
pub name: String,
pub url: String,
pub count: usize
}
#[derive(Deserialize, Debug)]
pub struct GalleryInfo {
pub id: usize,
pub media_id: String,
pub title: GalleryTitleInfo,
pub images: GalleryImagesInfo,
pub scanlator: String,
pub upload_date: usize,
pub tags: Vec<GalleryTagInfo>,
pub num_pages: usize,
pub num_favorites: usize
}
#[derive(Deserialize, Debug)]
pub struct SearchInfo {
pub result: Vec<GalleryInfo>,
pub num_pages: usize,
pub per_page: usize
}