pub struct ApiClient { /* private fields */ }Implementations§
Source§impl ApiClient
impl ApiClient
pub fn new(api_key: String, version: ApiVersion) -> Result<Self, GeneralError>
pub async fn get<T>(
&self,
path: &str,
params: Option<&HashMap<String, Vec<String>>>,
) -> Result<T, GeneralError>where
T: for<'de> Deserialize<'de>,
pub async fn post<T, U>(
&self,
path: &str,
data: Option<&T>,
) -> Result<U, GeneralError>where
T: Serialize,
U: for<'de> Deserialize<'de>,
pub async fn post_ignore_response<T>(
&self,
path: &str,
data: Option<&T>,
) -> Result<(), GeneralError>where
T: Serialize,
pub async fn put<T, U>(
&self,
path: &str,
data: Option<&T>,
params: Option<&HashMap<String, String>>,
) -> Result<U, GeneralError>where
T: Serialize,
U: for<'de> Deserialize<'de>,
pub async fn delete<T>(
&self,
path: &str,
data: Option<&T>,
) -> Result<(), GeneralError>where
T: Serialize,
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