Struct reddit::types::Comment

source ·
pub struct Comment {
Show 24 fields pub approved_by: Option<Box<str>>, pub author: Box<str>, pub author_flair_css_class: Option<Box<str>>, pub author_flair_text: Option<Box<str>>, pub banned_by: Option<Box<str>>, pub body: Box<str>, pub body_html: Box<str>, pub special: Option<Value>, pub gilded: u64, pub likes: Option<bool>, pub link_author: Option<Box<str>>, pub link_id: Box<str>, pub link_title: Option<Box<str>>, pub link_url: Option<Box<str>>, pub num_reports: Option<u64>, pub parent_id: Box<str>, pub saved: bool, pub score: i64, pub score_hidden: bool, pub subreddit: Box<str>, pub subreddit_id: Box<str>, pub distinguished: Option<Box<str>>, pub votable: Votable, pub created: Created,
}
Expand description

Implements votable | created kind == “t1” See https://github.com/reddit-archive/reddit/wiki/JSON#comment-implements-votable–created

Fields§

§approved_by: Option<Box<str>>

who approved this comment. null if nobody or you are not a mod

§author: Box<str>

the account name of the poster

§author_flair_css_class: Option<Box<str>>

the CSS class of the author’s flair. subreddit specific

§author_flair_text: Option<Box<str>>

the text of the author’s flair. subreddit specific

§banned_by: Option<Box<str>>

who removed this comment. null if nobody or you are not a mod

§body: Box<str>

the raw text. this is the unformatted text which includes the raw markup characters such as ** for bold. <, >, and & are escaped.

§body_html: Box<str>

the formatted HTML text as displayed on reddit. For example, text that is emphasised by * will now have tags wrapping it. Additionally, bullets and numbered lists will now be in HTML list format. NOTE: The HTML string will be escaped. You must unescape to get the raw HTML.

§special: Option<Value>

false if not edited, edit date in UTC epoch-seconds otherwise. NOTE: for some old edited comments on reddit.com, this will be set to true instead of edit date.

§gilded: u64

the number of times this comment received reddit gold

§likes: Option<bool>

how the logged-in user has voted on the comment - True = upvoted, False = downvoted, null = no vote

§link_author: Option<Box<str>>

present if the comment is being displayed outside its thread (user pages, /r/subreddit/comments/.json, etc.). Contains the author of the parent link

§link_id: Box<str>

ID of the link this comment is in

§link_title: Option<Box<str>>

present if the comment is being displayed outside its thread (user pages, /r/subreddit/comments/.json, etc.). Contains the title of the parent link

§link_url: Option<Box<str>>

present if the comment is being displayed outside its thread (user pages, /r/subreddit/comments/.json, etc.). Contains the URL of the parent link

§num_reports: Option<u64>

how many times this comment has been reported, null if not a mod

§parent_id: Box<str>

ID of the thing this comment is a reply to, either the link or a comment in it

§saved: bool

A list of replies to this comment true if this post is saved by the logged in user

§score: i64

the net-score of the comment

§score_hidden: bool

Whether the comment’s score is currently hidden.

§subreddit: Box<str>

subreddit of thing excluding the /r/ prefix. “pics”

§subreddit_id: Box<str>

the id of the subreddit in which the thing is locatedss

§distinguished: Option<Box<str>>

to allow determining whether they have been distinguished by moderators/admins. null = not distinguished. moderator = the green [M]. admin = the red [A]. special = various other special distinguishes http://redd.it/19ak1b

§votable: Votable

Voting Implementation

§created: Created

Created Implementation

Trait Implementations§

source§

impl Debug for Comment

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Comment

source§

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§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,