pub struct HttpClient { /* private fields */ }Implementations§
Source§impl HttpClient
impl HttpClient
pub fn new(token: String) -> Self
pub fn set_user_agent(&mut self, user_agent: String)
pub fn set_api_base_url(&mut self, url: String)
Sourcepub async fn execute<T: Endpoint + Send>(
&self,
endpoint: T,
) -> Result<T::Response, Box<ExecuteEndpointRequestError>>
pub async fn execute<T: Endpoint + Send>( &self, endpoint: T, ) -> Result<T::Response, Box<ExecuteEndpointRequestError>>
Send a request to the specified endpoint, returning the result.
§Errors
Returns an error if the response is not what is expected by the given endpoint or if a network error occurs.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HttpClient
impl !RefUnwindSafe for HttpClient
impl Send for HttpClient
impl Sync for HttpClient
impl Unpin for HttpClient
impl UnsafeUnpin for HttpClient
impl !UnwindSafe for HttpClient
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