Skip to main content

NullXApiClient

Struct NullXApiClient 

Source
pub struct NullXApiClient;
Expand description

A no-op X API client that returns XApiError::ApiError for every call.

Injected when tokens are missing or expired so that the MCP server can still start and serve config/scoring tools.

Trait Implementations§

Source§

impl XApiClient for NullXApiClient

Source§

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. Read more
Source§

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. Read more
Source§

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.
Source§

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.
Source§

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.
Source§

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.
Source§

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.
Source§

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,

Look up a user by their username.
Source§

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. Read more
Source§

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. Read more
Source§

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. Read more
Source§

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.
Source§

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.
Source§

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.
Source§

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.
Source§

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.
Source§

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.
Source§

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.
Source§

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).
Source§

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.
Source§

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.
Source§

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.
Source§

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.
Source§

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.
Source§

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.
Source§

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.
Source§

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.
Source§

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.
Source§

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.
Source§

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. Read more

Auto Trait Implementations§

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more