From f81ae37677e36eba58ff059466efb5c66eb89824 Mon Sep 17 00:00:00 2001 From: Igor Aleksanov Date: Tue, 1 Oct 2019 11:05:38 +0300 Subject: [PATCH] Add From for crate::dev::Payload (#1110) * Add From for crate::dev::Payload * Make dev::Payload field of Payload public and add into_inner method * Add changelog entry --- CHANGES.md | 6 ++++++ src/types/payload.rs | 9 ++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index b984e68cc..4ff7d1e66 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,11 @@ # Changes +## [1.0.9] - 2019-xx-xx + +### Added + +* Add `Payload::into_inner` method and make stored `def::Payload` public. (#1110) + ## [1.0.8] - 2019-09-25 ### Added diff --git a/src/types/payload.rs b/src/types/payload.rs index f33e2e5f1..8fc5f093e 100644 --- a/src/types/payload.rs +++ b/src/types/payload.rs @@ -43,7 +43,14 @@ use crate::request::HttpRequest; /// ); /// } /// ``` -pub struct Payload(crate::dev::Payload); +pub struct Payload(pub crate::dev::Payload); + +impl Payload { + /// Deconstruct to a inner value + pub fn into_inner(self) -> crate::dev::Payload { + self.0 + } +} impl Stream for Payload { type Item = Bytes;