mirror of https://github.com/fafhrd91/actix-web
update changelog
This commit is contained in:
parent
5bdf96aa8c
commit
d15c543040
|
@ -1,6 +1,14 @@
|
||||||
# Changes
|
# Changes
|
||||||
|
|
||||||
## Unreleased - 2021-xx-xx
|
## 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
|
### Removed
|
||||||
* `cookies` feature flag. [#2065]
|
* `cookies` feature flag. [#2065]
|
||||||
* Top-level `cookies` mod (re-export). [#2065]
|
* Top-level `cookies` mod (re-export). [#2065]
|
||||||
|
@ -13,6 +21,7 @@
|
||||||
|
|
||||||
[#2065]: https://github.com/actix/actix-web/pull/2065
|
[#2065]: https://github.com/actix/actix-web/pull/2065
|
||||||
[#2148]: https://github.com/actix/actix-web/pull/2148
|
[#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
|
## 3.0.0-beta.5 - 2021-04-02
|
||||||
|
|
|
@ -12,6 +12,7 @@ use crate::error::Error;
|
||||||
use super::{BodySize, BodyStream, MessageBody, SizedStream};
|
use super::{BodySize, BodyStream, MessageBody, SizedStream};
|
||||||
|
|
||||||
/// Represents various types of HTTP message body.
|
/// Represents various types of HTTP message body.
|
||||||
|
// #[deprecated(since = "4.0.0", note = "Use body types directly.")]
|
||||||
pub enum Body {
|
pub enum Body {
|
||||||
/// Empty response. `Content-Length` header is not set.
|
/// Empty response. `Content-Length` header is not set.
|
||||||
None,
|
None,
|
||||||
|
|
|
@ -386,6 +386,12 @@ impl BoxedResponseHead {
|
||||||
pub fn new(status: StatusCode) -> Self {
|
pub fn new(status: StatusCode) -> Self {
|
||||||
RESPONSE_POOL.with(|p| p.get_message(status))
|
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 {
|
impl std::ops::Deref for BoxedResponseHead {
|
||||||
|
|
|
@ -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.
|
/// An HTTP response builder.
|
||||||
///
|
///
|
||||||
/// This type can be used to construct an instance of `Response` through a builder-like pattern.
|
/// This type can be used to construct an instance of `Response` through a builder-like pattern.
|
||||||
|
|
Loading…
Reference in New Issue