pub struct Post {}
Expand description
Contains some properties of a Reddit post. For some real-world examples see this r/Polska request.
Fields§
§subreddit: String
eg. Polska
selftext: String
Text of the post
gilded: u32
Number of golds
title: String
Post title
name: String
Fullname, eg. t3_8z1v1z
score: i64
Upvotes - downvotes
created_utc: f32
UNIX timestamp of the post creation
over_18: bool
Is the post NSFW?
This is inconsistent with the over18
field in RedditSubreddit. THIS IS INTENTED AND CORRECT.
id: String
Fullname without the kind info, eg. 8z1v
subreddit_id: String
Subreddit fullname, eg. t5_2qh3s
username without u/
eg. spez
num_comments: u32
Number of comments
url: String
Standard url, without .json
at the end
stickied: bool
Is the post stickied?
Implementations§
source§impl Post
impl Post
Auto-generated by derive_getters::Getters
.
sourcepub fn created_utc(&self) -> &f32
pub fn created_utc(&self) -> &f32
UNIX timestamp of the post creation
sourcepub fn over_18(&self) -> &bool
pub fn over_18(&self) -> &bool
Is the post NSFW?
This is inconsistent with the over18
field in RedditSubreddit. THIS IS INTENTED AND CORRECT.
sourcepub fn subreddit_id(&self) -> &String
pub fn subreddit_id(&self) -> &String
Subreddit fullname, eg. t5_2qh3s
username without u/
eg. spez
sourcepub fn num_comments(&self) -> &u32
pub fn num_comments(&self) -> &u32
Number of comments
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>,
source§impl PartialEq for Post
impl PartialEq for Post
impl StructuralPartialEq 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more