1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! An opinionated utility to help with creating one-off idiomatic REST API clients.
//!
//! [`RestClient`] wraps a `reqwest_middleware::ClientWithMiddleware` and provides a uniform API
//! for making all types of http-json requests and parsing responses as json if possible.
//! Errors are rich and retain request context, and allow for further processing of unparseable responses.
//!
//! Typically means you can define the schema using serde-compatible types, and implement
//! an RPC-like client over `RestClient` with minimal boilerplate, where each call is 1-2 lines.
//! To do further API-specific processing of error responses, you can use `map_err` and match against
//! `Error::Response`, and do whatever you need to with the body of that response.
//!
//! Separately from this, [`CommonConfig`] helps to reduce boilerplate when setting up timeouts
//! and retries with backoff, which is appropriate in most situations that you make rest requests.
//!
//! [`LoggingRetryableStrategy`] is a reqwest-retry `RetryStrategy` which logs additional information
//! when requests need to be retried, and is attached when using `CommonConfig`.
pub use reqwest;
pub use reqwest_middleware;
pub use reqwest_retry;
pub use retry_policies;
pub use ;
pub use CommonRestConfig;
pub use LoggingRetryableStrategy;