pub struct ApiClient { /* private fields */ }Implementations§
Source§impl ApiClient
impl ApiClient
pub fn new(base_url: impl AsRef<str>) -> Result<Self>
pub fn with_basic_auth( self, username: impl Into<String>, token: impl Into<String>, ) -> Self
pub fn with_bearer_token(self, token: impl Into<String>) -> Self
pub fn with_retry_config(self, config: RetryConfig) -> Self
pub fn base_url(&self) -> &str
pub async fn get<T: DeserializeOwned>(&self, path: &str) -> Result<T>
pub async fn post<T: DeserializeOwned, B: Serialize + ?Sized>( &self, path: &str, body: &B, ) -> Result<T>
pub async fn put<T: DeserializeOwned, B: Serialize + ?Sized>( &self, path: &str, body: &B, ) -> Result<T>
pub async fn delete<T: DeserializeOwned>(&self, path: &str) -> Result<T>
pub async fn request<T: DeserializeOwned, B: Serialize + ?Sized>( &self, method: Method, path: &str, body: Option<&B>, ) -> Result<T>
pub fn apply_auth(&self, request: RequestBuilder) -> RequestBuilder
pub fn rate_limiter(&self) -> &RateLimiter
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ApiClient
impl !RefUnwindSafe for ApiClient
impl Send for ApiClient
impl Sync for ApiClient
impl Unpin for ApiClient
impl !UnwindSafe for ApiClient
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