Commit Graph

8 Commits

Author SHA1 Message Date
Dirkjan Ochtman
4c31a320be Upgrade dev-dependencies 2022-02-11 09:21:28 -08:00
Gurwinder Singh
f46840f3fa chore: cargo fmt, clippy 2019-08-16 22:27:39 -07:00
Jakub Beránek
db6b841e67 Update crate to Rust 2018 (#383) 2019-07-23 10:18:43 -07:00
Carl Lerche
8a9dfd14dc Move tests and support utilities to sub crates. (#268)
These crates will not be published to crates.io, but moving them allows
`tower-h2` to also depend on the test utilities.
2018-05-03 13:08:39 -07:00
Carl Lerche
88d1de2da0 Expose Codec via an unstable flag (#49)
Exposes `Codec` using an unstable flag. This is useful for testing.
2017-09-03 16:17:05 -07:00
Carl Lerche
c122e97127 Refactor errors (#46)
This patch does a bunch of refactoring, mostly around error types, but it also
paves the way to allow `Codec` to be used standalone.

* `Codec` (and `FramedRead` / `FramedWrite`) is broken out into a codec module.
* An h2-codec crate is created that re-exports the frame and codec modules.
* New error types are introduced in the internals:
  * `RecvError` represents errors caused by trying to receive a frame.
  * `SendError` represents errors caused by trying to send a frame.
  * `UserError` is an enum of potential errors caused by invalid usage
    by the user of the lib.
  * `ProtoError` is either a `Reason` or an `io::Error`. However it doesn't
    specify connection or stream level.
  * `h2::Error` is an opaque error type and is the only error type exposed
    by the public API (used to be `ConnectionError`).

There are misc code changes to enable this as well. The biggest is a new "sink"
API for `Codec`. It provides buffer which queues up a frame followed by flush
which writes everything that is queued. This departs from the `Sink` trait in
order to provide more accurate error values. For example, buffer can never fail
(but it will panic if `poll_ready` is not called first).
2017-09-02 11:12:50 -07:00
Carl Lerche
a7b92d5ec2 Restructure hpack tests 2017-06-29 23:11:35 -07:00
Carl Lerche
e41349572a Add huffman encoding 2017-06-01 12:35:20 -07:00