pub struct Tweet {
pub id: String,
pub text: String,
pub created_at: Option<String>,
pub author_id: Option<String>,
pub conversation_id: Option<String>,
pub in_reply_to_user_id: Option<String>,
pub public_metrics: Option<TweetPublicMetrics>,
pub referenced_tweets: Option<Vec<ReferencedTweet>>,
pub entities: Option<Value>,
pub attachments: Option<Value>,
pub extra: BTreeMap<String, Value>,
}Expand description
A tweet object from the X API v2.
Required fields: id, text (always present in API responses).
Optional fields depend on which tweet.fields the caller requests.
Fields§
§id: StringTweet identifier (X API snowflake string).
text: StringTweet body text.
created_at: Option<String>ISO-8601 timestamp the tweet was created.
Author’s user ID; resolve via includes.users when expanded.
conversation_id: Option<String>Root tweet ID of the conversation thread.
in_reply_to_user_id: Option<String>User ID this tweet replies to, when applicable.
public_metrics: Option<TweetPublicMetrics>Engagement counts (likes, replies, retweets, etc).
referenced_tweets: Option<Vec<ReferencedTweet>>Tweets this one references (reply, quote, retweet).
entities: Option<Value>Parsed entities (URLs, mentions, hashtags) — opaque JSON.
attachments: Option<Value>Media / poll attachment references — opaque JSON.
extra: BTreeMap<String, Value>Forward-compatibility bucket — captures unknown tweet fields.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Tweet
impl<'de> Deserialize<'de> for Tweet
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
Source§impl JsonSchema for Tweet
impl JsonSchema for Tweet
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for Tweet
impl RefUnwindSafe for Tweet
impl Send for Tweet
impl Sync for Tweet
impl Unpin for Tweet
impl UnsafeUnpin for Tweet
impl UnwindSafe for Tweet
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