nhentairs/src/structs.rs

52 lines
1.1 KiB
Rust

use serde::Deserialize;
#[derive(Deserialize, Debug)]
pub struct GalleryTitleInfo {
pub english: String,
pub japanese: String,
pub pretty: String,
}
#[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>,
pub cover: GalleryImageInfo,
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
}