update changelog

This commit is contained in:
Rob Ede 2021-04-12 22:01:54 +01:00
parent 5bdf96aa8c
commit d15c543040
No known key found for this signature in database
GPG Key ID: 97C636207D3EF933
4 changed files with 28 additions and 0 deletions

View File

@ -1,6 +1,14 @@
# Changes
## Unreleased - 2021-xx-xx
### Added
* `impl<T: MessageBody> MessageBody for Pin<Box<T>>`. [#2152]
### Changes
* The type parameter of `Response` no longer has a default. [#2152]
* The `Message` variant of `body::Body` is now `Pin<Box<dyn MessageBody>>`. [#2152]
* `BodyStream` and `SizedStream` are no longer restricted to Unpin types. [#2152]
### Removed
* `cookies` feature flag. [#2065]
* Top-level `cookies` mod (re-export). [#2065]
@ -13,6 +21,7 @@
[#2065]: https://github.com/actix/actix-web/pull/2065
[#2148]: https://github.com/actix/actix-web/pull/2148
[#2152]: https://github.com/actix/actix-web/pull/2152
## 3.0.0-beta.5 - 2021-04-02

View File

@ -12,6 +12,7 @@ use crate::error::Error;
use super::{BodySize, BodyStream, MessageBody, SizedStream};
/// Represents various types of HTTP message body.
// #[deprecated(since = "4.0.0", note = "Use body types directly.")]
pub enum Body {
/// Empty response. `Content-Length` header is not set.
None,

View File

@ -386,6 +386,12 @@ impl BoxedResponseHead {
pub fn new(status: StatusCode) -> Self {
RESPONSE_POOL.with(|p| p.get_message(status))
}
pub(crate) fn take(&mut self) -> Self {
BoxedResponseHead {
head: self.head.take(),
}
}
}
impl std::ops::Deref for BoxedResponseHead {

View File

@ -238,6 +238,18 @@ impl<B: MessageBody> fmt::Debug for Response<B> {
}
}
impl<B: Unpin> Future for Response<B> {
type Output = Result<Response<B>, Error>;
fn poll(mut self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<Self::Output> {
Poll::Ready(Ok(Response {
head: self.head.take(),
body: self.body.take_body(),
error: self.error.take(),
}))
}
}
/// An HTTP response builder.
///
/// This type can be used to construct an instance of `Response` through a builder-like pattern.