I’m quite new to Rust and have now I serious problem, for which I couldn’t find any solution by searching the web.
I’m working on a small web server with iron and here the content of the request body is implementing the Read trait. This content is parsed but there are sometimes problems with the parsing and I like to printout the raw content of the request for debugging.
When I read the body with read_to_string() I can see the content of the request (good!) but of course the content has been consumed and is lost for the application (bad…).
Is there a possibility to get the content of the reader without consuming it? Rewind the reader? Both the receiving and the parsing are done by external crates, so it is no solution to but some debug code there…
Thank you very much in advance!