Struct ibdl_common::post::Post
source · pub struct Post {
pub id: u64,
pub website: ImageBoards,
pub url: String,
pub md5: String,
pub extension: String,
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: String
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 PartialEq for Post
impl PartialEq for Post
source§impl PartialOrd for Post
impl PartialOrd for Post
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Post
impl StructuralEq for Post
Auto Trait Implementations§
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
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.