Struct ibdl_common::post::Post
source · pub struct Post {
pub id: u64,
pub url: String,
pub md5: String,
pub extension: String,
pub rating: Rating,
pub tags: Vec<String>,
}Expand description
Catchall model for the necessary parts of the imageboard post to properly identify, download and save it.
Fields
id: u64ID number of the post given by the imageboard
url: StringDirect URL of the original image file located inside the imageboard’s server
md5: StringInstead of calculating the downloaded file’s MD5 hash on the fly, it uses the one provided by the API.
extension: StringThe 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: RatingRating of the post. Can be:
Rating::Safefor SFW postsRating::Questionablefor a not necessarily SFW postRating::Explicitfor NSFW postsRating::Unknownin 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
sourceimpl<'de> Deserialize<'de> for Post
impl<'de> Deserialize<'de> for Post
sourcefn 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
sourceimpl Ord for Post
impl Ord for Post
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<Post> for Post
impl PartialOrd<Post> for Post
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
1.0.0 · sourcefn 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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.