pub struct Client { /* private fields */ }Implementations§
Source§impl Client
impl Client
pub fn new(bearer_token: &str, timeout_sec: Option<Duration>) -> Self
pub async fn new_from_key( consumer_key: &str, consumer_secret: &str, timeout_sec: Option<Duration>, ) -> Result<Option<Self>, Error>
pub async fn new_by_env( timeout_sec: Option<Duration>, ) -> Result<Option<Self>, Error>
pub async fn get( &self, url: &str, query_options: &Vec<(&str, &str)>, ) -> Result<Response, Error>
pub async fn post( &self, url: &str, query_options: &Vec<(&str, &str)>, form_options: &Vec<(&str, &str)>, ) -> Result<Response, Error>
pub async fn json( &self, url: &str, query_options: &Vec<(&str, &str)>, data: &Value, ) -> Result<Response, Error>
pub async fn put( &self, url: &str, query_options: &Vec<(&str, &str)>, ) -> Result<Response, Error>
pub async fn delete( &self, url: &str, query_options: &Vec<(&str, &str)>, ) -> Result<Response, Error>
pub async fn multipart( &self, url: &str, query_options: &Vec<(&str, &str)>, data: Form, ) -> Result<Response, Error>
Auto Trait Implementations§
impl Freeze for Client
impl RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
impl UnwindSafe for Client
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