pub struct Http { /* private fields */ }Implementations§
Source§impl Http
impl Http
pub fn new(token: String) -> Self
pub async fn get<T: DeserializeOwned>(&self, path: &str) -> Result<T, HttpError>
pub async fn get_with_query<T: DeserializeOwned, Q: Serialize>( &self, path: &str, query: &Q, ) -> Result<T, HttpError>
pub async fn post<T: DeserializeOwned, B: Serialize>( &self, path: &str, body: &B, ) -> Result<T, HttpError>
pub async fn patch<T: DeserializeOwned, B: Serialize>( &self, path: &str, body: &B, ) -> Result<T, HttpError>
pub async fn delete_with_query<Q: Serialize>( &self, path: &str, query: Option<&Q>, ) -> Result<(), HttpError>
pub async fn delete(&self, path: &str) -> Result<(), HttpError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Http
impl !RefUnwindSafe for Http
impl Send for Http
impl Sync for Http
impl Unpin for Http
impl !UnwindSafe for Http
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