pub struct Client { /* private fields */ }Implementations§
Source§impl Client
impl Client
pub fn new() -> Self
pub async fn fetch( &self, url: &str, ) -> Result<String, Box<dyn Error + Send + Sync>>
pub async fn get<T: DeserializeOwned>( &self, url: &str, ) -> Result<T, Box<dyn Error + Send + Sync>>
pub async fn post<T: Serialize + ?Sized, U: DeserializeOwned>( &self, url: &str, body: &T, ) -> Result<U, Box<dyn Error + Send + Sync>>
pub async fn put<T: Serialize + ?Sized, U: DeserializeOwned>( &self, url: &str, body: &T, ) -> Result<U, Box<dyn Error + Send + Sync>>
pub async fn patch<T: Serialize + ?Sized, U: DeserializeOwned>( &self, url: &str, body: &T, ) -> Result<U, Box<dyn Error + Send + Sync>>
pub async fn delete<U: DeserializeOwned>( &self, url: &str, ) -> Result<U, Box<dyn Error + Send + Sync>>
pub async fn delete_with_payload<T: Serialize + ?Sized, U: DeserializeOwned>( &self, url: &str, body: &T, ) -> Result<U, Box<dyn Error + Send + Sync>>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin 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