Documentation for `header_read_timeout` is incomplete
Three mini-issues here:
-
Documentation for
.header_read_timeout()doesn't mention that it requires.timer()or it'll panic. -
The example in the docs for
http1::Builderusesheader_read_timeoutwithouttimer. It's not meant as complete running code, but still, it's weird that if you did try to use it, you'd panic. -
No pointer to an implementation of Timer for tokio. I found a full implementation in a doc-comment, but unfortunately that's a private module.
The example Timer implementation for Tokio is a working example. The module is private, but we're exposing hyper::rt::{Sleep, Timer} here, which is what you'd need to implement this.
I agree with all of that. I think the three points all still stand, as opportunities for improvement. Will eventually give it a shot if nobody beats me to it.
That's fair. The doc for rt::{Timer,Sleep} is also asked in #3411.
There is an implementation available in hyper-util, maybe this can be mentioned in the documentation.
The docs for hyper::rt will be added in https://github.com/hyperium/hyperium.github.io/pull/121.
Will close this issue since we're also tracking it in #3411, and header_read_timeout docs were updated.
Thanks for the report @jorendorff !