pub struct TwitterClient {
pub client: Client,
pub auth: Box<dyn TwitterAuth + Send + Sync>,
}Fields§
§client: Client§auth: Box<dyn TwitterAuth + Send + Sync>Implementations§
Source§impl TwitterClient
impl TwitterClient
pub fn new(auth: Box<dyn TwitterAuth + Send + Sync>) -> Result<Self>
pub async fn send_tweet( &self, text: &str, media_ids: Option<Vec<String>>, ) -> Result<Tweet>
pub async fn get_tweet(&self, tweet_id: &str) -> Result<Tweet>
pub async fn get_user_tweets( &self, user_id: &str, limit: usize, ) -> Result<Vec<Tweet>>
pub async fn get<T: DeserializeOwned>(&self, endpoint: &str) -> Result<T>
pub async fn get_with_params<T: DeserializeOwned>( &self, endpoint: &str, params: Option<Value>, ) -> Result<T>
pub async fn post<T: DeserializeOwned>( &self, endpoint: &str, params: Option<Value>, ) -> Result<T>
pub async fn request<T: DeserializeOwned>( &self, method: Method, endpoint: &str, params: Option<Value>, ) -> Result<T>
Auto Trait Implementations§
impl Freeze for TwitterClient
impl !RefUnwindSafe for TwitterClient
impl Send for TwitterClient
impl Sync for TwitterClient
impl Unpin for TwitterClient
impl !UnwindSafe for TwitterClient
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