Tweet

Struct Tweet 

Source
pub struct Tweet<'a> {
Show 27 fields pub coordinates: Option<Geometry>, pub created_at: DateTime, pub entities: Entities<'a>, pub favorite_count: Option<u64>, pub favorited: Option<bool>, pub filter_level: Option<FilterLevel<'a>>, pub id: StatusId, pub in_reply_to_screen_name: Option<Cow<'a, str>>, pub in_reply_to_status_id: Option<StatusId>, pub in_reply_to_user_id: Option<UserId>, pub is_quote_status: bool, pub lang: Option<Cow<'a, str>>, pub place: Option<Place<'a>>, pub possibly_sensitive: Option<bool>, pub quoted_status_id: Option<StatusId>, pub quoted_status: Option<Box<Tweet<'a>>>, pub scopes: Option<HashMap<String, JsonValue>>, pub retweet_count: u64, pub retweeted: bool, pub retweeted_status: Option<Box<Tweet<'a>>>, pub source: Cow<'a, str>, pub text: Cow<'a, str>, pub truncated: bool, pub user: User<'a>, pub withheld_copyright: bool, pub withheld_in_countries: Vec<Cow<'a, str>>, pub withheld_scope: Option<WithheldScope<'a>>,
}
Expand description

Represents a Tweet.

§Reference

Tweets — Twitter Developers

Fields§

§coordinates: Option<Geometry>

Represents the geographic location of this Tweet as reported by the user or client application.

§created_at: DateTime

UTC time when this Tweet was created.

§entities: Entities<'a>

Entities which have been parsed out of the text of the Tweet.

§favorite_count: Option<u64>

Indicates approximately how many times this Tweet has been liked by Twitter users.

§favorited: Option<bool>

Perspectival Indicates whether this Tweet has been liked by the authenticating user.

§filter_level: Option<FilterLevel<'a>>

Indicates the maximum value of the filter_level parameter which may be used and still stream this Tweet. So a value of Medium will be streamed on None, Low, and Medium streams.

§id: StatusId

The integer representation of the unique identifier for this Tweet.

§in_reply_to_screen_name: Option<Cow<'a, str>>

If the represented Tweet is a reply, this field will contain the screen name of the original Tweet’s author.

§in_reply_to_status_id: Option<StatusId>

If the represented Tweet is a reply, this field will contain the integer representation of the original Tweet’s ID.

§in_reply_to_user_id: Option<UserId>

If the represented Tweet is a reply, this field will contain the integer representation of the original Tweet’s author ID. This will not necessarily always be the user directly mentioned in the Tweet.

§is_quote_status: bool§lang: Option<Cow<'a, str>>

When present, indicates a BCP 47 language identifier corresponding to the machine-detected language of the Tweet text, or und if no language could be detected.

§place: Option<Place<'a>>

When present, indicates that the tweet is associated (but not necessarily originating from) a Place.

§possibly_sensitive: Option<bool>

This field only surfaces when a Tweet contains a link. The meaning of the field doesn’t pertain to the Tweet content itself, but instead it is an indicator that the URL contained in the Tweet may contain content or media identified as sensitive content.

§quoted_status_id: Option<StatusId>

This field only surfaces when the Tweet is a quote Tweet. This field contains the integer value Tweet ID of the quoted Tweet.

§quoted_status: Option<Box<Tweet<'a>>>

This field only surfaces when the Tweet is a quote Tweet. This attribute contains the Tweet object of the original Tweet that was quoted.

§scopes: Option<HashMap<String, JsonValue>>

A set of key-value pairs indicating the intended contextual delivery of the containing Tweet. Currently used by Twitter’s Promoted Products.

§retweet_count: u64

Number of times this Tweet has been retweeted.

§retweeted: bool

Perspectival Indicates whether this Tweet has been retweeted by the authenticating user.

§retweeted_status: Option<Box<Tweet<'a>>>

Users can amplify the broadcast of Tweets authored by other users by retweeting. Retweets can be distinguished from typical Tweets by the existence of a retweeted_status attribute. This attribute contains a representation of the original Tweet that was retweeted.

Note that retweets of retweets do not show representations of the intermediary retweet, but only the original Tweet. (Users can also unretweet a retweet they created by deleting their retweet.)

§source: Cow<'a, str>

Utility used to post the Tweet, as an HTML-formatted string. Tweets from the Twitter website have a source value of web.

§text: Cow<'a, str>

The actual UTF-8 text of the status update. See twitter-text for details on what is currently considered valid characters.

§truncated: bool

Indicates whether the value of the text parameter was truncated, for example, as a result of a retweet exceeding the 140 character Tweet length. Truncated text will end in ellipsis, like this ...

Since Twitter now rejects long Tweets vs truncating them, the large majority of Tweets will have this set to false.

Note that while native retweets may have their toplevel text property shortened, the original text will be available under the retweeted_status object and the truncated parameter will be set to the value of the original status (in most cases, false).

§user: User<'a>

The user who posted this Tweet. Perspectival attributes embedded within this object are unreliable.

§withheld_copyright: bool

When set to true, it indicates that this piece of content has been withheld due to a DMCA complaint.

§withheld_in_countries: Vec<Cow<'a, str>>

When present, indicates a list of uppercase two-letter country codes this content is withheld from. Twitter supports the following non-country values for this field:

  • XX - Content is withheld in all countries
  • XY - Content is withheld due to a DMCA request.
§withheld_scope: Option<WithheldScope<'a>>

When present, indicates whether the content being withheld is the Status or a User.

Trait Implementations§

Source§

impl<'a> Clone for Tweet<'a>

Source§

fn clone(&self) -> Tweet<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for Tweet<'a>

Source§

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

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

impl<'de: 'a, 'a> Deserialize<'de> for Tweet<'a>

Source§

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<'a> PartialEq for Tweet<'a>

Source§

fn eq(&self, other: &Tweet<'a>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> StructuralPartialEq for Tweet<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for Tweet<'a>

§

impl<'a> RefUnwindSafe for Tweet<'a>

§

impl<'a> Send for Tweet<'a>

§

impl<'a> Sync for Tweet<'a>

§

impl<'a> Unpin for Tweet<'a>

§

impl<'a> UnwindSafe for Tweet<'a>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

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