pub struct RestClient { /* private fields */ }Implementations§
Source§impl RestClient
impl RestClient
pub fn new(base_url: String, requests_per_minute: u32) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Sourcepub async fn request<T: DeserializeOwned>(
&self,
method: Method,
path: &str,
headers: Vec<(&str, &str)>,
body: Option<impl Serialize>,
) -> Result<T>
pub async fn request<T: DeserializeOwned>( &self, method: Method, path: &str, headers: Vec<(&str, &str)>, body: Option<impl Serialize>, ) -> Result<T>
Make HTTP request with rate limiting
Sourcepub async fn get<T: DeserializeOwned>(
&self,
path: &str,
headers: Vec<(&str, &str)>,
) -> Result<T>
pub async fn get<T: DeserializeOwned>( &self, path: &str, headers: Vec<(&str, &str)>, ) -> Result<T>
GET request
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