pub struct ReqClient {
pub client: Client,
pub api_key: String,
pub base_url: Url,
pub user_agent: String,
pub headers: HashMap<String, String>,
}
Fields§
§client: Client
§api_key: String
§base_url: Url
§user_agent: String
§headers: HashMap<String, String>
Implementations§
Source§impl ReqClient
impl ReqClient
pub fn new(api_key: String) -> Self
pub fn new_custom(http_client: Client, api_key: String) -> Self
pub fn new_request(&self, method: Method, path: &str) -> RequestBuilder
pub fn new_body_request<T: Serialize + ?Sized>( &self, method: Method, path: &str, json: Option<&T>, ) -> RequestBuilder
pub async fn exec<'a, T: DeserializeOwned>( &self, req: RequestBuilder, ) -> Result<APIResponse<T>, APIResponse<T>>
Auto Trait Implementations§
impl Freeze for ReqClient
impl !RefUnwindSafe for ReqClient
impl Send for ReqClient
impl Sync for ReqClient
impl Unpin for ReqClient
impl !UnwindSafe for ReqClient
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