pub struct Post {
pub id: u64,
pub website: ImageBoards,
pub url: String,
pub md5: String,
pub extension: Extension,
pub rating: Rating,
pub tags: Vec<Tag>,
}
Expand description
Catchall model for the necessary parts of the imageboard post to properly identify, download and save it.
Fields§
§id: u64
ID number of the post given by the imageboard
website: ImageBoards
The imageboard where this post was extracted from
url: String
Direct URL of the original image file located inside the imageboard’s server
md5: String
Instead of calculating the downloaded file’s MD5 hash on the fly, it uses the one provided by the API.
extension: Extension
The original file extension provided by the imageboard.
https://konachan.com
(Moebooru) and some other imageboards don’t provide this field. So, additional work is required to get the file extension from the url
rating: Rating
Rating of the post. Can be:
Rating::Safe
for SFW postsRating::Questionable
for a not necessarily SFW postRating::Explicit
for NSFW postsRating::Unknown
in case none of the above are correctly parsed
Set of tags associated with the post.
Used to exclude posts according to a blacklist
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Post
impl<'de> Deserialize<'de> for Post
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for Post
impl Ord for Post
Source§impl PartialOrd for Post
impl PartialOrd for Post
impl Eq for Post
Auto Trait Implementations§
impl Freeze for Post
impl RefUnwindSafe for Post
impl Send for Post
impl Sync for Post
impl Unpin for Post
impl UnwindSafe for Post
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more