[][src]Struct tweet::Tweet

pub struct Tweet {
    pub created_at: DateTime<Utc>,
    pub id: u64,
    pub id_str: String,
    pub text: String,
    pub source: String,
    pub truncated: bool,
    pub in_reply_to_status_id: Option<u64>,
    pub in_reply_to_status_id_str: Option<String>,
    pub in_reply_to_user_id: Option<u64>,
    pub in_reply_to_user_id_str: Option<String>,
    pub in_reply_to_screen_name: Option<String>,
    pub user: User,
    pub extended_tweet: Option<ExtendedTweet>,
    pub coordinates: Option<Coordinates>,
    pub place: Option<Place>,
    pub quoted_status_id: Option<u64>,
    pub quoted_status_id_str: Option<String>,
    pub is_quote_status: bool,
    pub quoted_status: Option<Box<Tweet>>,
    pub retweeted_status: Option<Box<Tweet>>,
    pub quote_count: Option<u32>,
    pub reply_count: u32,
    pub retweet_count: u32,
    pub favorite_count: Option<u32>,
    pub entities: Option<Entity>,
    pub extended_entities: Option<ExtendedEntity>,
    pub favorited: Option<bool>,
    pub retweeted: bool,
    pub possibly_sensitive: Option<bool>,
    pub filter_level: String,
    pub lang: Option<String>,
    pub withheld_copyright: Option<bool>,
    pub withheld_in_countries: Option<Vec<String>>,
    pub withheld_scope: Option<String>,
    pub contributors: Option<String>,
    pub display_text_range: Option<(u32, u32)>,
    pub geo: Option<Coordinates>,
    pub quoted_status_permalink: Option<LegacyUrl>,
    pub timestamp_ms: Option<String>,
}

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 since 0.2.0:

Deprecated in the Twitter API, but kept here for completion.

display_text_range: Option<(u32, u32)>
Deprecated since 0.2.0:

Deprecated in the Twitter API, but kept here for completion.

geo: Option<Coordinates>
Deprecated since 0.2.0:

Deprecated in the Twitter API, but kept here for completion. Use coordinates instead.

quoted_status_permalink: Option<LegacyUrl>
Deprecated since 0.2.0:

Deprecated in the Twitter API, but kept here for completion.

timestamp_ms: Option<String>
Deprecated since 0.2.0:

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.

impl Serialize for Tweet[src]

impl<'de> Deserialize<'de> for Tweet[src]

Auto Trait Implementations

impl Send for Tweet

impl Sync for Tweet

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

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