I'd like to understand how I might intercept every HTTP request a Hyper HTTP Client makes. I might want this e.g. to log each request (Uri, Method, Headers, etc) or to check a local cache before making a real request in a test scenario (like Ruby's vcr gem).
My first attempt was to build a Connector that delegates to an HttpsConnector
and I got it working but that seems like the wrong level of abstraction and I can't get headers or HTTP method, only Uri.
I like the gateway example in the Hyper repo. While I understand that conceptually the client is also a Service in Hyper, I'm having trouble understanding how to provide my own Service for the Client to use.
Any guidance is appreciated. I'm about a month into learning Rust so it's highly likely that this is simple to do and I just don't know how yet.
thx!