Move Response::unit and stream to the heap

This commit is contained in:
Martin Algesten
2021-03-24 21:01:42 +01:00
parent cfaca317c6
commit 7c6ed53df3
3 changed files with 26 additions and 8 deletions

View File

@@ -225,13 +225,13 @@ impl PoolKey {
/// *Internal API*
pub(crate) struct PoolReturnRead<R: Read + Sized + Into<Stream>> {
// unit that contains the agent where we want to return the reader.
unit: Option<Unit>,
unit: Option<Box<Unit>>,
// wrapped reader around the same stream
reader: Option<R>,
}
impl<R: Read + Sized + Into<Stream>> PoolReturnRead<R> {
pub fn new(unit: Option<Unit>, reader: R) -> Self {
pub fn new(unit: Option<Box<Unit>>, reader: R) -> Self {
PoolReturnRead {
unit,
reader: Some(reader),