The current `Builder` methods `http2_initial_stream_window_size` and
`http2_initial_connection_window_size` take `&mut self`, while every
other builder method takes `self`. That breaks up the chaining of
options.
This patch adds two methods that configure the same option, but take
`self` instead, and have an underscore suffix (so,
`http2_initial_stream_window_size_`).
cc #1814
This adds a `http_body::Body` impl for hypers `Body`. This should
allow us to start moving to a more generic body trait based on
`BufStream` and `http-body`.
- Placed all cases of "unexpected bytes" errors into the
`UnexpectedMessage` variant.
- Placed all cases of "unexpected EOF" errors into the
`IncompleteMessage` variant. Description is now generic about
"connection closed before message completed", instead of mentioning
"request" or "response.
- Added `Error::is_incomplete_message()` accessor to help checking for
unexpected closures.
- Renamed some variants to be clearer when viewing the `Debug` format.
- Collected all "user" errors into an internal `User` enum, to prevent
forgetting to update the `is_user()` method.
The previous version only showed a JSON GET API.
Deserializing the body of a POST request is not
trivial so the example should show it.
The new example takes the JSON body sent in a
POST request, deserializes it, adds a field, then
serializes it and sends it back.
Signed-off-by: Ole Herman Schumacher Elgesem <oleherman93@gmail.com>
The `Error::source()` is searched for an `h2::Error` to allow sending
different error codes in the GOAWAY. If none is found, it defaults to
`INTERNAL_ERROR`.
* Add `server::conn::Connection::without_shutdown`
Returns wrapper Future instance which allows
to use `poll_without_shutdown` method
more ergonomically.
* Add `client::conn::Connection::without_shutdown`
Returns wrapper Future instance which allows
to use `poll_without_shutdown` method
more ergonomically.
* Improve `poll_without_shutdown` docs
Closes#1786
Include the creation of server too. Previously, the parameter type of
the closure had a different type than the default server provided, which
wasn't obvious to the user.