pub trait XApiClient: Send + Sync {
Show 30 methods
// Required methods
fn search_tweets<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
query: &'life1 str,
max_results: u32,
since_id: Option<&'life2 str>,
pagination_token: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<SearchResponse, XApiError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn get_mentions<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
user_id: &'life1 str,
since_id: Option<&'life2 str>,
pagination_token: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<MentionResponse, XApiError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn post_tweet<'life0, 'life1, 'async_trait>(
&'life0 self,
text: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<PostedTweet, XApiError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn reply_to_tweet<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
text: &'life1 str,
in_reply_to_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<PostedTweet, XApiError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn get_tweet<'life0, 'life1, 'async_trait>(
&'life0 self,
tweet_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Tweet, XApiError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_me<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<User, XApiError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_user_tweets<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_id: &'life1 str,
max_results: u32,
pagination_token: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<SearchResponse, XApiError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn get_user_by_username<'life0, 'life1, 'async_trait>(
&'life0 self,
username: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<User, XApiError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided methods
fn upload_media<'life0, 'life1, 'async_trait>(
&'life0 self,
_data: &'life1 [u8],
_media_type: MediaType,
) -> Pin<Box<dyn Future<Output = Result<MediaId, XApiError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn post_tweet_with_media<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
text: &'life1 str,
_media_ids: &'life2 [String],
) -> Pin<Box<dyn Future<Output = Result<PostedTweet, XApiError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn reply_to_tweet_with_media<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
text: &'life1 str,
in_reply_to_id: &'life2 str,
_media_ids: &'life3 [String],
) -> Pin<Box<dyn Future<Output = Result<PostedTweet, XApiError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait { ... }
fn quote_tweet<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_text: &'life1 str,
_quoted_tweet_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<PostedTweet, XApiError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn like_tweet<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_user_id: &'life1 str,
_tweet_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, XApiError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn follow_user<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_user_id: &'life1 str,
_target_user_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, XApiError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn unfollow_user<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_user_id: &'life1 str,
_target_user_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, XApiError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn retweet<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_user_id: &'life1 str,
_tweet_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, XApiError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn unretweet<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_user_id: &'life1 str,
_tweet_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, XApiError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn delete_tweet<'life0, 'life1, 'async_trait>(
&'life0 self,
_tweet_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, XApiError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn get_home_timeline<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_user_id: &'life1 str,
_max_results: u32,
_pagination_token: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<SearchResponse, XApiError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn unlike_tweet<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_user_id: &'life1 str,
_tweet_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, XApiError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn get_followers<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_user_id: &'life1 str,
_max_results: u32,
_pagination_token: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<UsersResponse, XApiError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn get_following<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_user_id: &'life1 str,
_max_results: u32,
_pagination_token: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<UsersResponse, XApiError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn get_user_by_id<'life0, 'life1, 'async_trait>(
&'life0 self,
_user_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<User, XApiError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn get_liked_tweets<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_user_id: &'life1 str,
_max_results: u32,
_pagination_token: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<SearchResponse, XApiError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn get_bookmarks<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_user_id: &'life1 str,
_max_results: u32,
_pagination_token: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<SearchResponse, XApiError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn bookmark_tweet<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_user_id: &'life1 str,
_tweet_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, XApiError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn unbookmark_tweet<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_user_id: &'life1 str,
_tweet_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, XApiError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn get_users_by_ids<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_user_ids: &'life1 [&'life2 str],
) -> Pin<Box<dyn Future<Output = Result<UsersResponse, XApiError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn get_tweet_liking_users<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_tweet_id: &'life1 str,
_max_results: u32,
_pagination_token: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<UsersResponse, XApiError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn raw_request<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
_method: &'life1 str,
_url: &'life2 str,
_query: Option<&'life3 [(String, String)]>,
_body: Option<&'life4 str>,
_headers: Option<&'life5 [(String, String)]>,
) -> Pin<Box<dyn Future<Output = Result<RawApiResponse, XApiError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait { ... }
}Expand description
Trait abstracting all X API v2 operations.
Implementations include XApiHttpClient for real API calls and
mock implementations for testing.
Required Methods§
Sourcefn search_tweets<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
query: &'life1 str,
max_results: u32,
since_id: Option<&'life2 str>,
pagination_token: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<SearchResponse, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn search_tweets<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
query: &'life1 str,
max_results: u32,
since_id: Option<&'life2 str>,
pagination_token: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<SearchResponse, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Search recent tweets matching the given query.
Returns up to max_results tweets. If since_id is provided,
only returns tweets newer than that ID.
Sourcefn get_mentions<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
user_id: &'life1 str,
since_id: Option<&'life2 str>,
pagination_token: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<MentionResponse, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn get_mentions<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
user_id: &'life1 str,
since_id: Option<&'life2 str>,
pagination_token: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<MentionResponse, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Get mentions for the authenticated user.
If since_id is provided, only returns mentions newer than that ID.
Sourcefn post_tweet<'life0, 'life1, 'async_trait>(
&'life0 self,
text: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<PostedTweet, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn post_tweet<'life0, 'life1, 'async_trait>(
&'life0 self,
text: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<PostedTweet, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Post a new tweet.
Sourcefn reply_to_tweet<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
text: &'life1 str,
in_reply_to_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<PostedTweet, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn reply_to_tweet<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
text: &'life1 str,
in_reply_to_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<PostedTweet, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Reply to an existing tweet.
Sourcefn get_tweet<'life0, 'life1, 'async_trait>(
&'life0 self,
tweet_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Tweet, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_tweet<'life0, 'life1, 'async_trait>(
&'life0 self,
tweet_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Tweet, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get a single tweet by ID.
Sourcefn get_me<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<User, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_me<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<User, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the authenticated user’s profile.
Sourcefn get_user_tweets<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_id: &'life1 str,
max_results: u32,
pagination_token: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<SearchResponse, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_user_tweets<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_id: &'life1 str,
max_results: u32,
pagination_token: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<SearchResponse, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Get recent tweets from a specific user.
Provided Methods§
Sourcefn upload_media<'life0, 'life1, 'async_trait>(
&'life0 self,
_data: &'life1 [u8],
_media_type: MediaType,
) -> Pin<Box<dyn Future<Output = Result<MediaId, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn upload_media<'life0, 'life1, 'async_trait>(
&'life0 self,
_data: &'life1 [u8],
_media_type: MediaType,
) -> Pin<Box<dyn Future<Output = Result<MediaId, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Upload media to X API for attaching to tweets.
Default implementation returns an error — override in concrete clients.
Sourcefn post_tweet_with_media<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
text: &'life1 str,
_media_ids: &'life2 [String],
) -> Pin<Box<dyn Future<Output = Result<PostedTweet, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn post_tweet_with_media<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
text: &'life1 str,
_media_ids: &'life2 [String],
) -> Pin<Box<dyn Future<Output = Result<PostedTweet, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Post a new tweet with media attachments.
Default delegates to post_tweet (ignoring media) for backward compat.
Sourcefn reply_to_tweet_with_media<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
text: &'life1 str,
in_reply_to_id: &'life2 str,
_media_ids: &'life3 [String],
) -> Pin<Box<dyn Future<Output = Result<PostedTweet, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn reply_to_tweet_with_media<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
text: &'life1 str,
in_reply_to_id: &'life2 str,
_media_ids: &'life3 [String],
) -> Pin<Box<dyn Future<Output = Result<PostedTweet, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Reply to an existing tweet with media attachments.
Default delegates to reply_to_tweet (ignoring media) for backward compat.
Sourcefn quote_tweet<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_text: &'life1 str,
_quoted_tweet_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<PostedTweet, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn quote_tweet<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_text: &'life1 str,
_quoted_tweet_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<PostedTweet, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Post a quote tweet referencing another tweet.
Sourcefn like_tweet<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_user_id: &'life1 str,
_tweet_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn like_tweet<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_user_id: &'life1 str,
_tweet_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Like a tweet on behalf of the authenticated user.
Sourcefn follow_user<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_user_id: &'life1 str,
_target_user_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn follow_user<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_user_id: &'life1 str,
_target_user_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Follow a user on behalf of the authenticated user.
Sourcefn unfollow_user<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_user_id: &'life1 str,
_target_user_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn unfollow_user<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_user_id: &'life1 str,
_target_user_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Unfollow a user on behalf of the authenticated user.
Sourcefn retweet<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_user_id: &'life1 str,
_tweet_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn retweet<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_user_id: &'life1 str,
_tweet_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Retweet a tweet on behalf of the authenticated user.
Sourcefn unretweet<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_user_id: &'life1 str,
_tweet_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn unretweet<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_user_id: &'life1 str,
_tweet_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Undo a retweet on behalf of the authenticated user.
Sourcefn delete_tweet<'life0, 'life1, 'async_trait>(
&'life0 self,
_tweet_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_tweet<'life0, 'life1, 'async_trait>(
&'life0 self,
_tweet_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete a tweet by its ID.
Sourcefn get_home_timeline<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_user_id: &'life1 str,
_max_results: u32,
_pagination_token: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<SearchResponse, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_home_timeline<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_user_id: &'life1 str,
_max_results: u32,
_pagination_token: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<SearchResponse, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Get the authenticated user’s home timeline (reverse chronological).
Sourcefn unlike_tweet<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_user_id: &'life1 str,
_tweet_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn unlike_tweet<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_user_id: &'life1 str,
_tweet_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Unlike a tweet on behalf of the authenticated user.
Sourcefn get_followers<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_user_id: &'life1 str,
_max_results: u32,
_pagination_token: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<UsersResponse, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_followers<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_user_id: &'life1 str,
_max_results: u32,
_pagination_token: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<UsersResponse, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Get followers of a user.
Sourcefn get_following<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_user_id: &'life1 str,
_max_results: u32,
_pagination_token: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<UsersResponse, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_following<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_user_id: &'life1 str,
_max_results: u32,
_pagination_token: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<UsersResponse, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Get accounts a user is following.
Sourcefn get_user_by_id<'life0, 'life1, 'async_trait>(
&'life0 self,
_user_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<User, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_user_by_id<'life0, 'life1, 'async_trait>(
&'life0 self,
_user_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<User, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get a user by their ID.
Sourcefn get_liked_tweets<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_user_id: &'life1 str,
_max_results: u32,
_pagination_token: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<SearchResponse, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_liked_tweets<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_user_id: &'life1 str,
_max_results: u32,
_pagination_token: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<SearchResponse, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Get tweets liked by a user.
Sourcefn get_bookmarks<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_user_id: &'life1 str,
_max_results: u32,
_pagination_token: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<SearchResponse, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_bookmarks<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_user_id: &'life1 str,
_max_results: u32,
_pagination_token: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<SearchResponse, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Get the authenticated user’s bookmarks.
Sourcefn bookmark_tweet<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_user_id: &'life1 str,
_tweet_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn bookmark_tweet<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_user_id: &'life1 str,
_tweet_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Bookmark a tweet.
Sourcefn unbookmark_tweet<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_user_id: &'life1 str,
_tweet_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn unbookmark_tweet<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_user_id: &'life1 str,
_tweet_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Remove a bookmark.
Sourcefn get_users_by_ids<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_user_ids: &'life1 [&'life2 str],
) -> Pin<Box<dyn Future<Output = Result<UsersResponse, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_users_by_ids<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_user_ids: &'life1 [&'life2 str],
) -> Pin<Box<dyn Future<Output = Result<UsersResponse, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Get multiple users by their IDs.
Sourcefn get_tweet_liking_users<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_tweet_id: &'life1 str,
_max_results: u32,
_pagination_token: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<UsersResponse, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_tweet_liking_users<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_tweet_id: &'life1 str,
_max_results: u32,
_pagination_token: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<UsersResponse, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Get users who liked a specific tweet.
Sourcefn raw_request<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
_method: &'life1 str,
_url: &'life2 str,
_query: Option<&'life3 [(String, String)]>,
_body: Option<&'life4 str>,
_headers: Option<&'life5 [(String, String)]>,
) -> Pin<Box<dyn Future<Output = Result<RawApiResponse, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
fn raw_request<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
_method: &'life1 str,
_url: &'life2 str,
_query: Option<&'life3 [(String, String)]>,
_body: Option<&'life4 str>,
_headers: Option<&'life5 [(String, String)]>,
) -> Pin<Box<dyn Future<Output = Result<RawApiResponse, XApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
Execute a raw HTTP request against the X API.
The caller is responsible for constructing a valid, pre-validated URL. The implementation adds Bearer token authentication automatically. Returns the raw HTTP response including status, selected headers, and body text.
method must be one of: GET, POST, PUT, DELETE.