Our use-case required using Reqwest with middleware with the reqwest_middleware crate for caching purposes. I extended the library to use the reqwest_maybe_middleware crate internally, which is very lightweight by itself. If middleware is required, the reqwest_middleware crate can be included with the optional feature enable-reqwest-middleware, which is internally passed to reqwest_maybe_middleware.
To facilitate this internally, I created a new function get_requests to wrap a common pattern for using reqwest.
In order to make it easier to work with the produced responses in a polars DataFrame, I added the Copy trait to several objects that had a very small size, such as 2-tuples of ints and enums with no extra fields.
I also ran rustfmt on all changed files, which caused several unintended consequences for formatting. However, it may be good practice to run rustfmt (perhaps with custom settings) after every commit in the future, to prevent this and enforce consistent formatting.
Our use-case required using Reqwest with middleware with the
reqwest_middleware crate
for caching purposes. I extended the library to use thereqwest_maybe_middleware crate
internally, which is very lightweight by itself. If middleware is required, thereqwest_middleware crate
can be included with the optional featureenable-reqwest-middleware
, which is internally passed toreqwest_maybe_middleware
.To facilitate this internally, I created a new function
get_requests
to wrap a common pattern for using reqwest.In order to make it easier to work with the produced responses in a
polars
DataFrame, I added the Copy trait to several objects that had a very small size, such as 2-tuples of ints and enums with no extra fields.I also ran rustfmt on all changed files, which caused several unintended consequences for formatting. However, it may be good practice to run rustfmt (perhaps with custom settings) after every commit in the future, to prevent this and enforce consistent formatting.