1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-06-28 14:30:36 +02:00

add FramedParts::with_read_buf method

This commit is contained in:
Nikolay Kim
2019-03-06 22:53:55 -08:00
parent 51bd7d2721
commit b407c65f4c
3 changed files with 19 additions and 1 deletions

View File

@ -349,4 +349,17 @@ impl<T, U> FramedParts<T, U> {
_priv: (),
}
}
/// Create a new `FramedParts` with read buffer
pub fn with_read_buf(io: T, codec: U, read_buf: BytesMut) -> FramedParts<T, U> {
FramedParts {
io,
codec,
read_buf,
write_buf: BytesMut::new(),
write_buf_lw: LW,
write_buf_hw: HW,
_priv: (),
}
}
}