Add basic posts struct
This commit is contained in:
parent
2ff09b6291
commit
d7361ee5e5
2 changed files with 41 additions and 0 deletions
|
@ -1 +1,2 @@
|
|||
mod client;
|
||||
mod post;
|
||||
|
|
40
src/post.rs
Normal file
40
src/post.rs
Normal 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
|
||||
}
|
Loading…
Reference in a new issue