Commit Graph

395 Commits

Author SHA1 Message Date
Sean McArthur
2983395d63 chore(lib): update pretty_env_logger to v0.4 (#2123) 2020-01-29 12:08:43 -08:00
Sean McArthur
5c6536317c docs(examples): improve README for examples directory 2020-01-29 11:09:21 -08:00
Sean McArthur
ba2a144f8b fix(client): strip path from Uri before calling Connector (#2109) 2020-01-13 11:45:28 -08:00
Sean McArthur
61b62eeac8 v0.13.1 2019-12-16 11:44:04 -08:00
Sean McArthur
4b6099c7aa feat(body): implement HttpBody for Request and Response
When the body type of a `Request` or `Response` implements `HttpBody`,
the `Request` or `Response` itself now implements `HttpBody`.

This allows writing things like `hyper::body::aggregate(req)` instead of
`hyper::body::aggregate(req.into_body())`.

Closes #2067
2019-12-13 10:48:30 -08:00
Euclidr
bfda390617 docs(server): http_proxy example 2019-12-12 16:59:38 -08:00
Sean McArthur
070c84ec43 v0.13.0 2019-12-10 09:45:42 -08:00
Sean McArthur
245fa9c44c refactor(server): remove Unpin requirement from the Body generic 2019-12-06 13:27:08 -08:00
Sean McArthur
8ba9a8d2c4 feat(body): add body::aggregate and body::to_bytes functions
Adds utility functions to `hyper::body` to help asynchronously
collecting all the buffers of some `HttpBody` into one.

- `aggregate` will collect all into an `impl Buf` without copying the
  contents. This is ideal if you don't need a contiguous buffer.
- `to_bytes` will copy all the data into a single contiguous `Bytes`
  buffer.
2019-12-06 10:03:05 -08:00
Sean McArthur
b0060f277e chore(CI): enable GitHub Actions 2019-12-05 13:12:35 -08:00
Sean McArthur
0b03b73053 feat(lib): rename unstable-stream feature to stream and enable by default
Closes #2034
2019-12-04 17:09:10 -08:00
Sean McArthur
a738d03fd3 chore(dependencies): update to http-body 0.3 2019-12-04 16:48:06 -08:00
David Barsky
19a7aab51f chore(dependencies): update tower-service to 0.3 2019-12-04 12:13:14 -08:00
Sean McArthur
6ae5889f83 feat(rt): introduce rt::Executor trait
The `hyper::rt::Executor` trait allows defining custom executors to be
used with hyper's `Client` and `Server`.

Closes #1944

BREAKING CHANGE: Any type passed to the `executor` builder methods must
  now implement `hyper::rt::Executor`.

  `hyper::rt::spawn` usage should be replaced with `tokio::task::spawn`.

  `hyper::rt::run` usage should be replaced with `#[tokio::main]` or
  managing a `tokio::runtime::Runtime` manually.
2019-12-04 11:38:23 -08:00
Sean McArthur
cb3f39c2dc feat(lib): update Tokio, bytes, http, h2, and http-body 2019-12-04 10:56:34 -08:00
Daniel Johnson
71d088d3d0 chore(dependencies): update futures to 0.3.1 2019-11-14 10:04:16 -08:00
Sean McArthur
8b878a805a perf(client): change HttpConnecting to hold Arc<Config> instead of inlined fields 2019-10-23 16:21:51 -07:00
Sean McArthur
4f2743991c feat(service): rename Service to HttpService, re-export tower::Service`
The only important trait for a user is the `tower::Service` trait, which
is now available also at `hyper::service::Service`. The other "trait
aliases" are no longer publicly exported, as people thought they had to
implement them.

Also removes dependency on `tower-make`, which is trivial but otherwise
shouldn't affect anyone.

Closes #1959
2019-10-21 11:01:28 -07:00
Sean McArthur
2d6bbd2cd8 chore(ci): re-enable CI running on beta 2019-10-18 15:16:07 -07:00
Ben Boeckel
536b1e184e fix(dependencies): require correct bytes minimum version (#1975)
`Bytes::advance` was introduced in this version.
2019-10-14 11:28:41 -07:00
Sean McArthur
0ef12a11a8 v0.13.0-alpha.4 2019-10-01 11:43:38 -07:00
Sean McArthur
64fe70b2f9 chore(dependencies): update http-body to alpha.3 2019-10-01 11:39:57 -07:00
Sean McArthur
353be888fa v0.13.0-alpha.3 2019-10-01 10:28:13 -07:00
Sean McArthur
7601fc6b8d chore(dependencies): update http-body to alpha.2 2019-10-01 10:25:08 -07:00
Sean McArthur
5b348b821c feat(lib): add optional tcp feature, split from runtime
The `HttpConnector` and `AddrListener` types which make use of
`tokio::tcp` have been made their own optional feature. This allows
using them without requiring the *full* tokio runtime.
2019-10-01 10:15:46 -07:00
Jon Gjengset
02b584435f chore(dependencies): Use new alpha release of h2 2019-10-01 09:39:29 -07:00
Taiki Endo
d2b0fed028 chore(dependencies): update tokio, h2, and tower 2019-10-01 06:40:41 -07:00
Taiki Endo
bcb66736fb chore(dependencies): update pin-project to 0.4 2019-10-01 06:40:41 -07:00
Sean McArthur
d40978ce08 v0.13.0-alpha.2 2019-09-24 12:21:24 -07:00
Taiki Endo
053d6497bd chore(dependencies): update tokio, h2, and tower-make 2019-09-23 12:45:37 -07:00
Sean McArthur
2b0405c48c refactor(lib): rename 'stream' feature to 'unstable-stream' 2019-09-11 16:09:49 -07:00
Jon Gjengset
1f3a8393e8 chore(dependencies): update pin-project to 0.4.0-alpha.11 2019-09-11 10:22:12 -07:00
Jon Gjengset
cf9e5b0aa8 chore(dependencies): update pin-project to 0.4.0-alpha.10 2019-09-11 09:23:16 -07:00
Sean McArthur
511ea3889b feat(body): put Stream impl for Body behind stream feature
BREAKING CHANGE: Using a `Body` as a `Stream`, and constructing one via
  `Body::wrap_stream`, require enabling the unstable `stream` feature.
2019-09-05 15:56:58 -07:00
Sean McArthur
b3e5506261 feat(server): introduce Accept trait
The `Accept` trait is used by the server types to asynchronously accept
incoming connections. This replaces the previous usage of `Stream`.

BREAKING CHANGE: Passing a `Stream` to `Server::builder` or
  `Http::serve_incoming` must be changed to pass an `Accept` instead. The
  `stream` optional feature can be enabled, and the a stream can be
  converted using `hyper::server:🉑:from_stream`.
2019-09-05 14:47:39 -07:00
Taiki Endo
ac45f1ac45 chore(dependencies): update pin-project to 0.4.0-alpha.9 2019-09-04 15:21:20 -07:00
Sean McArthur
0c2a727970 v0.13.0-alpha.1 2019-09-04 11:48:31 -07:00
Aaron Hill
4c552a4960 refactor(lib): Use pin-project crate to perform pin projections
Remove all pin-related `unsafe` code from Hyper, as well as the
now-unused 'pin-utils' dependency.
2019-09-03 12:31:35 -07:00
Sean McArthur
347a10eb05 chore(ci): re-enable running of tests in CI 2019-08-30 17:47:05 -07:00
Lucio Franco
eee2a72879 feat(client): provide tower::Service support for clients (#1915) 2019-08-30 12:54:22 -07:00
Sean McArthur
049b5132db feat(client): change GaiResolver to use a global blocking threadpool
BREAKING CHANGE: Calls to `GaiResolver::new` and `HttpConnector::new` no
  longer should pass an integer argument for the number of threads.
2019-08-29 14:16:43 -07:00
Sean McArthur
5b1feb8a3c refactor(lib): update to tokio alpha.4 2019-08-29 13:12:44 -07:00
Sean McArthur
ffd554aa37 chore(dependencies): pin alphas to specific versions 2019-08-29 10:43:29 -07:00
Lucio Franco
79c32f8953 feat(body): Update Payload to be a trait alias of http_body::Body (#1908) 2019-08-22 14:13:27 -07:00
Sean McArthur
2d525aaae4 chore(dependencies): update to want 0.3 2019-08-20 12:02:05 -07:00
Lucio Franco
ec520d5602 feat(service): use tower_service::Service for hyper::service 2019-08-20 12:01:06 -07:00
Sean McArthur
292bb5f2b2 chore(dependencies): update to futures alpha 18
Closes #1897
2019-08-19 16:30:13 -07:00
Sean McArthur
41f4173615 refactor(http2): re-enable http2 client and server support 2019-08-19 15:55:49 -07:00
Douman
4920f5e264 chore(dependencies): Upgrade tokio 2019-08-19 09:00:21 -07:00
Alex Gaynor
c1d40f30b5 chore(dependencies): Bump spmc, since 0.2 was yanked 2019-08-17 11:51:57 -07:00