pub struct Comment {
subreddit_id: String,
subreddit: String,
replies: Option<KindContainer>,
author: String,
body: String,
permalink: String,
created_utc: f32,
depth: Option<u32>,
score: i64,
}
Expand description
Represents a reply to a Post
Fields§
§subreddit_id: String
ID of the subreddit, eg. t5_2qh3s
subreddit: String
Name of the subreddit, eg. Polska
replies: Option<KindContainer>
Replies to the comment, if any
Comment author, eg. spez, without u/
body: String
Comment text
permalink: String
Standard url to the comment, without .json
at the end
created_utc: f32
UNIX timestamp of the comment creation
depth: Option<u32>
Depth of the comment in the thread. 0 is the top-level comment, 1 is a reply to the top-level comment, etc.
When fetching posts/comments from a user, this field is always None
.
score: i64
Upvotes - downvotes
Implementations§
source§impl Comment
impl Comment
Auto-generated by derive_getters::Getters
.
sourcepub fn subreddit_id(&self) -> &String
pub fn subreddit_id(&self) -> &String
ID of the subreddit, eg. t5_2qh3s
sourcepub fn replies(&self) -> &Option<KindContainer>
pub fn replies(&self) -> &Option<KindContainer>
Replies to the comment, if any
Comment author, eg. spez, without u/
sourcepub fn created_utc(&self) -> &f32
pub fn created_utc(&self) -> &f32
UNIX timestamp of the comment creation
Trait Implementations§
source§impl<'de> Deserialize<'de> for Comment
impl<'de> Deserialize<'de> for Comment
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
Auto Trait Implementations§
impl Freeze for Comment
impl RefUnwindSafe for Comment
impl Send for Comment
impl Sync for Comment
impl Unpin for Comment
impl UnwindSafe for Comment
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
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)
🔬This is a nightly-only experimental API. (
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>
Converts
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>
Converts
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