pub struct RestClient {
pub base_url: Url,
/* private fields */
}Fields§
§base_url: UrlImplementations§
Source§impl RestClient
impl RestClient
pub async fn get<T: DeserializeOwned + Debug + ?Sized>( &self, path: &str, ) -> Result<T>
pub async fn post<P: Serialize + Debug + ?Sized, T: DeserializeOwned + Debug + ?Sized>( &self, path: &str, payload: &P, ) -> Result<T>
pub async fn put<P: Serialize + Debug + ?Sized, T: DeserializeOwned + Debug + ?Sized>( &self, path: &str, payload: &P, ) -> Result<T>
pub async fn delete<T: DeserializeOwned + Debug + ?Sized>( &self, path: &str, ) -> Result<T>
Trait Implementations§
Source§impl Clone for RestClient
impl Clone for RestClient
Source§fn clone(&self) -> RestClient
fn clone(&self) -> RestClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RestClient
impl !RefUnwindSafe for RestClient
impl Send for RestClient
impl Sync for RestClient
impl Unpin for RestClient
impl !UnwindSafe for RestClient
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