[−][src]Struct tweet::Tweet
Represents a tweet
Fields
created_at: DateTime<Utc>
When the tweet was posted
id: u64
The unique id for the tweet
id_str: String
String version of id
text: String
The possibly truncated text of the tweet
source: String
The client that posted the tweet
truncated: bool
Whether or not the text field is truncated to 140 characters
in_reply_to_status_id: Option<u64>
If this tweet is a reply, this will contain the original tweet id
in_reply_to_status_id_str: Option<String>
Same as in_reply_to_status_id
, but a String
in_reply_to_user_id: Option<u64>
If this tweet is a reply, this will contain the original author id
in_reply_to_user_id_str: Option<String>
Same as in_reply_to_user_id
, but a String
in_reply_to_screen_name: Option<String>
If this tweet is a reply, contains the original user's screen name
user: User
The user who posted this tweet
extended_tweet: Option<ExtendedTweet>
If the tweet was truncated because it was longer than 140 chars, this contains the rest of the text
coordinates: Option<Coordinates>
Represents the geographic location of this tweet as reported by user/client
place: Option<Place>
The place that this tweet is associated with
quoted_status_id: Option<u64>
If this tweet is a quote, it contains the of the quoted tweet id
quoted_status_id_str: Option<String>
Same as quoted_status_id_str
, but a String
is_quote_status: bool
Whether this is a quoted tweet or not
quoted_status: Option<Box<Tweet>>
When the tweet is a quote tweet, this contains the quoted tweet
retweeted_status: Option<Box<Tweet>>
When the tweet is a retweet, this contains the retweeted tweet
quote_count: Option<u32>
Approximate count of times tweet was quoted
reply_count: u32
How many times this tweet has been replied to
retweet_count: u32
How many times this tweet has been retweeted
favorite_count: Option<u32>
How many times this tweet has been favorited
entities: Option<Entity>
Entities that have been parsed from the tweet
extended_entities: Option<ExtendedEntity>
If there are media entities, this field contains them all
favorited: Option<bool>
Whether the authenticated user favorited this tweet
retweeted: bool
Whether the authenticated user retweeted this tweet
possibly_sensitive: Option<bool>
Whether a link in this tweet (including media) is potentially sensitive
filter_level: String
What filter level is associated with this tweet. Can be none, low, or medium.
lang: Option<String>
BCP 47 language identifier corresponding to machine-detected language of tweet
withheld_copyright: Option<bool>
Indicates whether content was removed via DMCA
withheld_in_countries: Option<Vec<String>>
Indicates what countries this tweet is unavailable
withheld_scope: Option<String>
Indicates whether content is being withheld because of "status" or "user"
contributors: Option<String>
Deprecated in the Twitter API, but kept here for completion.
display_text_range: Option<(u32, u32)>
Deprecated in the Twitter API, but kept here for completion.
geo: Option<Coordinates>
Deprecated in the Twitter API, but kept here for completion. Use coordinates instead.
quoted_status_permalink: Option<LegacyUrl>
Deprecated in the Twitter API, but kept here for completion.
timestamp_ms: Option<String>
Deprecated in the Twitter API, but kept here for completion. Used created_at instead.
Methods
impl Tweet
[src]
pub fn is_sensitive(&self) -> bool
[src]
Determine whether Twitter thinks this post is sensitive or not. For tweets that do not have this attribute, the default return value is false.
pub fn is_retweet(&self) -> bool
[src]
Determine whether this is a retweet or not.
pub fn is_extended(&self) -> bool
[src]
Determine whether the tweet is extended or not
pub fn has_media(&self) -> bool
[src]
Returns true when the tweet has a photo, gif, or video.
pub fn base_id(&self) -> u64
[src]
If it's a retweet, the original tweet id is returned. Otherwise the current tweet id is returned.
pub fn url(&self) -> String
[src]
Creates a direct URL to the status
pub fn full_text(&self) -> String
[src]
When a tweet is extended it can go over the 140 character limit. In such cases, the tweet text field is truncated as noted by the truncated flag. This method will check the extended tweet data and return either it, the full retweet text if it was truncated or the original text field depending on what's appropriate.
pub fn media_urls(&self) -> Vec<String>
[src]
Gathers all media urls from the post into a Vec
.
For videos and gifs this will always have a single
url, but for photos it can be up to 4 max.
pub fn hashtags(&self) -> Vec<String>
[src]
Gets a list of hashtags associated with the tweet
Trait Implementations
impl Debug for Tweet
[src]
impl FromStr for Tweet
[src]
type Err = Error
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl Serialize for Tweet
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de> Deserialize<'de> for Tweet
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,