pub struct Request<T>where
T: Serialize,{ /* private fields */ }Implementations§
Source§impl<T> Request<T>
impl<T> Request<T>
Sourcepub fn new(config: RequestConfig, endpoint: &str, p: T) -> Self
pub fn new(config: RequestConfig, endpoint: &str, p: T) -> Self
Create a new request by using a config, the desired endpoint and a Serializeable value T which will be formatted to json
Sourcepub fn with_auth(&mut self, auth: Authorization)
pub fn with_auth(&mut self, auth: Authorization)
Use the given authorization for the request
Sourcepub fn with_method(&mut self, method: Method)
pub fn with_method(&mut self, method: Method)
Use the given HTTP Method for the request
Sourcepub async fn do_request_void(self) -> Result<(), Error>
pub async fn do_request_void(self) -> Result<(), Error>
Do a request but don’t parse the body
Sourcepub async fn do_request<U>(self) -> Result<RequestResult<U>, Error>where
U: DeserializeOwned,
pub async fn do_request<U>(self) -> Result<RequestResult<U>, Error>where
U: DeserializeOwned,
Do a request but try to parse the body into a RequestResult
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Request<T>where
T: Freeze,
impl<T> RefUnwindSafe for Request<T>where
T: RefUnwindSafe,
impl<T> Send for Request<T>where
T: Send,
impl<T> Sync for Request<T>where
T: Sync,
impl<T> Unpin for Request<T>where
T: Unpin,
impl<T> UnsafeUnpin for Request<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Request<T>where
T: UnwindSafe,
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