pub struct RestClient { /* private fields */ }Implementations§
Source§impl RestClient
impl RestClient
pub fn new(base_url: &'static str) -> Self
pub async fn get<T, P>(
&self,
endpoint: Option<&str>,
params: Option<&P>,
headers: Option<&HeaderMap>,
) -> Result<T, ExchangeError>where
T: DeserializeOwned,
P: Serialize,
pub async fn post<T, P>(
&self,
endpoint: Option<&str>,
body: Option<&P>,
headers: Option<&HeaderMap>,
) -> Result<T, ExchangeError>where
T: DeserializeOwned,
P: Serialize,
Auto Trait Implementations§
impl !RefUnwindSafe for RestClient
impl !UnwindSafe for RestClient
impl Freeze for RestClient
impl Send for RestClient
impl Sync for RestClient
impl Unpin for RestClient
impl UnsafeUnpin 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