From b407c65f4cb9bb6af1c6667d3928bf6132ee77af Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Wed, 6 Mar 2019 22:53:55 -0800 Subject: [PATCH] add FramedParts::with_read_buf method --- actix-codec/CHANGES.md | 5 +++++ actix-codec/Cargo.toml | 2 +- actix-codec/src/framed.rs | 13 +++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/actix-codec/CHANGES.md b/actix-codec/CHANGES.md index aefde3cd..b79c2f0d 100644 --- a/actix-codec/CHANGES.md +++ b/actix-codec/CHANGES.md @@ -1,5 +1,10 @@ # Changes +## [0.1.0] - 2019-03-06 + +* Added `FramedParts::with_read_buffer()` method. + + ## [0.1.0] - 2018-12-09 * Move codec to separate crate diff --git a/actix-codec/Cargo.toml b/actix-codec/Cargo.toml index 104527f0..ace40c5c 100644 --- a/actix-codec/Cargo.toml +++ b/actix-codec/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "actix-codec" -version = "0.1.0" +version = "0.1.1" authors = ["Nikolay Kim "] description = "Utilities for encoding and decoding frames" keywords = ["network", "framework", "async", "futures"] diff --git a/actix-codec/src/framed.rs b/actix-codec/src/framed.rs index 3c92ee54..20b31308 100644 --- a/actix-codec/src/framed.rs +++ b/actix-codec/src/framed.rs @@ -349,4 +349,17 @@ impl FramedParts { _priv: (), } } + + /// Create a new `FramedParts` with read buffer + pub fn with_read_buf(io: T, codec: U, read_buf: BytesMut) -> FramedParts { + FramedParts { + io, + codec, + read_buf, + write_buf: BytesMut::new(), + write_buf_lw: LW, + write_buf_hw: HW, + _priv: (), + } + } }