Releases: hyperium/hyper
v0.12.5
- Adjusted minimum h2 dependency version.
v0.12.4
v0.12.3
v0.12.2: HTTP Upgrades
Bug Fixes
Features
v0.12.1
Bug Fixes
Features
v0.12.0
Features
- lib:
- body:
- client:
- rename
FutureResponsetoResponseFuture(04c74ef5) - support local bind for
HttpConnector(b6a3c85d, closes #1498) - add support for title case header names (#1497) (a02fec8c, closes #1492)
- add support to set
SO_NODELAYon client HTTP sockets (016d79ed, closes #1473) - improve construction of
Clients (fe1578ac) - redesign the
Connecttrait (8c52c2df, closes #1428)
- rename
- error: revamp
hyper::Errortype (5d3c4722, closes #1128, #1130, #1431, #1338) - rt: make tokio runtime optional (d127201e)
- server:
- service: introduce hyper-specific
Service(2dc6202f, closes #1461)
Bug Fixes
- lib: remove deprecated tokio-proto APIs (a37e6b59)
- server: panic on max_buf_size too small (aac250f2)
Breaking Changes
-
Body::is_empty()is gone. Replace with
Body::is_end_stream(), from thePayloadtrait.(19f90242)
-
Each payload chunk must implement
Buf, instead of
justAsRef<[u8]>.(a3be110a)
-
Replace any references of
hyper::client::FutureResponsetohyper::client::ResponseFuture.(04c74ef5)
-
The
Servicetrait has changed: it has some changed
associated types, andcallis now bound to&mut self.The
NewServicetrait has changed: it has some changed associated
types, andnew_servicenow returns aFuture.Clientno longer implementsServicefor now.hyper::server::conn::Servenow returnsConnectinginstead of
Connections, sincenew_servicecan now return aFuture. The
Connectingis a future wrapping the new service future, returning
aConnectionafterwards. In many cases,Future::flattencan be
used.(2dc6202f)
-
The
Serveris no longer created fromHttp::bind,
nor is itrun. It is aFuturethat must be polled by an
Executor.The
hyper::server::Httptype has move to
hyper::server::conn::Http.(c4974500)
-
Client:new(&handle)andClient::configure()are now
Client::new()andClient::builder().(fe1578ac)
-
Erroris no longer an enum to pattern match over, or
to construct. Code will need to be updated accordingly.For body streams or
Services, inference might be unable to determine
what error type you mean to return.(5d3c4722)
-
All uses of
Handlenow need to be new-tokioHandle.(27b8db3a)
-
Custom connectors should now implement
Connect
directly, instead ofService.Calls to
connectno longer takeUris, butDestination. There
arescheme,host, andportmethods to query relevant
information.The returned future must be a tuple of the transport and
Connected.
If no relevant extra information is needed, simply return
Connected::new().(8c52c2df)
-
All code that was generic over the body as
Streammust
be adjusted to use aPayloadinstead.hyper::Bodycan still be used as aStream.Passing a custom
impl Streamwill need to either implement
Payload, or as an easier option, switch toBody::wrap_stream.Body::pairhas been replaced withBody::channel, which returns a
hyper::body::Senderinstead of afutures::sync::mpsc::Sender.(fbc449e4)
-
Method,Request,Response,StatusCode,
Version, andUrihave been replaced with types from thehttp
crate.(3cd48b45)
- The variants of
Methodare now uppercase, for instance,Method::Getis nowMethod::GET. - The variants of
StatusCodeare now uppercase, for instance,StatusCode::Okis nowStatusCode::OK. - The variants of
Versionare now uppercase, for instance,HttpVersion::Http11is nowVersion::HTTP_11.
- The variants of
-
The typed headers from
hyper::headerare gone for now.
The http::header module is re-exported as hyper::header.
For example, a before setting the content-length:
use hyper::header::ContentLength;
res.headers_mut().set(ContentLength(15));And now after, with the http types:
use hyper::header::{CONTENT_LENGTH, HeaderValue};
res.headers_mut().insert(CONTENT_LENGTH, HeaderValue::from_static("15"));(3cd48b45)
-
The
mimecrate is no longer re-exported ashyper::mime.The typed headers don't exist, and so they do not need the
mimecrate.To continue using
mimefor other purposes, add it directly to yourCargo.toml
as a dependency.(3cd48b45)
-
Removed
compatcargo feature, andcompatrelated API. This was the conversion methods for hyper's
types to and fromhttpcrate's types.(3cd48b45)
-
Removed deprecated APIs:
(a37e6b59)- The
server-protocargo feature, which includedimpl ServerProto for Http, and related associated types. client::Config::no_proto()tokio_proto::streaming::Body::from(hyper::Body)hyper::Body::from(tokio_proto::streaming::Body)hyper::Body::from(futures::sync::mpsc::Receiver)Http::no_proto()
- The