I'm trying to write some code that will interact with a web service that talks protobuf. So far I'm using prost to translate protobuf definitions into Rust structs and hyper as an HTTP stack, but I've run into a basic Rust road-block right out of the gate; I'm sure this is basic borrow checker stuff, just not sure how to resolve it.
Here's some sample code on the playground: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=501c1c850909fecc8b9b821082a9f684
The idea is to create a request builder and configure it with what doesn't change from request to request; then to re-use it to build each individual request; in actual use this code will also supply a request body, but I'm still trying to work out how to do that too For now, I just need to figure out how to fix this problem...
Any help appreciated!