Add basic posts struct

This commit is contained in:
Leon Grünewald 2024-01-01 21:50:57 +01:00
parent 2ff09b6291
commit d7361ee5e5
2 changed files with 41 additions and 0 deletions

View file

@ -1 +1,2 @@
mod client; mod client;
mod post;

40
src/post.rs Normal file
View file

@ -0,0 +1,40 @@
pub type Id = u64;
pub type FileSize = u64;
pub type ImageDimension = u64;
pub struct Post {
id: Id,
created_at: String,
updated_at: String,
tags: PostTags,
file: PostFile,
rating: String,
fav_count: u16,
sources: Vec<String>,
approver_id: Id,
uploader_ud: Id,
description: String,
comment_count: u16,
has_notes: bool,
is_favorited: bool,
change_seq: u128
}
pub struct PostTags {
general: Vec<String>,
artist: Vec<String>,
copyright: Vec<String>,
character: Vec<String>,
invalid: Vec<String>,
meta: Vec<String>,
lore: Vec<String>
}
pub struct PostFile {
width: ImageDimension,
height: ImageDimension,
ext: String,
size: FileSize,
md5: String,
url: String
}