Add pub to struct fields

This commit is contained in:
Leon Grünewald 2024-01-01 21:50:57 +01:00
parent 70bdfede77
commit ec2b8f7b0d

View file

@ -17,48 +17,48 @@ impl Into<Vec<Post>> for Posts {
#[derive(serde::Deserialize, Clone, Debug)] #[derive(serde::Deserialize, Clone, Debug)]
pub struct Post { pub struct Post {
id: Id, pub id: Id,
created_at: String, pub created_at: String,
updated_at: String, pub updated_at: String,
tags: PostTags, pub tags: PostTags,
file: PostFile, pub file: PostFile,
rating: String, pub rating: String,
fav_count: u16, pub fav_count: u16,
sources: Vec<String>, pub sources: Vec<String>,
approver_id: Option<Id>, pub approver_id: Option<Id>,
uploader_id: Id, pub uploader_id: Id,
description: String, pub description: String,
comment_count: u16, pub comment_count: u16,
has_notes: bool, pub has_notes: bool,
is_favorited: bool, pub is_favorited: bool,
change_seq: Option<u128>, pub change_seq: Option<u128>,
relationships: PostRelationships pub relationships: PostRelationships
} }
#[derive(serde::Deserialize, Clone, Debug)] #[derive(serde::Deserialize, Clone, Debug)]
pub struct PostTags { pub struct PostTags {
general: Vec<String>, pub general: Vec<String>,
artist: Vec<String>, pub artist: Vec<String>,
copyright: Vec<String>, pub copyright: Vec<String>,
character: Vec<String>, pub character: Vec<String>,
invalid: Vec<String>, pub invalid: Vec<String>,
meta: Vec<String>, pub meta: Vec<String>,
lore: Vec<String> pub lore: Vec<String>
} }
#[derive(serde::Deserialize, Clone, Debug)] #[derive(serde::Deserialize, Clone, Debug)]
pub struct PostFile { pub struct PostFile {
width: ImageDimension, pub width: ImageDimension,
height: ImageDimension, pub height: ImageDimension,
ext: String, pub ext: String,
size: FileSize, pub size: FileSize,
md5: String, pub md5: String,
url: String pub url: String
} }
#[derive(serde::Deserialize, Clone, Debug)] #[derive(serde::Deserialize, Clone, Debug)]
pub struct PostRelationships { pub struct PostRelationships {
parent_id: Option<Id>, pub parent_id: Option<Id>,
has_children: bool, pub has_children: bool,
has_active_children: bool, pub has_active_children: bool,
} }