summaryrefslogtreecommitdiffstats
path: root/tokio-util/src/codec/mod.rs
diff options
context:
space:
mode:
authorPlecra <60934058+Plecra@users.noreply.github.com>2020-05-12 12:47:38 +0100
committerGitHub <noreply@github.com>2020-05-12 13:47:38 +0200
commit221f421464e6672e9cf25629998477946a8b8e1f (patch)
treecdb0898dcb0a3d80177fccd0729cd28525e0b96e /tokio-util/src/codec/mod.rs
parent1cc016833569e2dbae3b0431b7c87d5e75ef5de6 (diff)
codec: rewrite of codec::Framed (#2368)
Framed was designed to encapsulate both AsyncRead and AsyncWrite so that it could wrap two-way connections. It used Fuse to manage the pinned io object between the FramedWrite and FramedRead structs. I replaced the Fuse struct by isolating the state used in reading and writing, and making the code generic over that instead. This means the FramedImpl struct now has a parameter for the state, and contains the logic for both directions. The Framed* structs are now simply wrappers around this type Hopefully removing the `Pin` handling made things easier to understand, too.
Diffstat (limited to 'tokio-util/src/codec/mod.rs')
-rw-r--r--tokio-util/src/codec/mod.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/tokio-util/src/codec/mod.rs b/tokio-util/src/codec/mod.rs
index ec76a641..96e9f9f9 100644
--- a/tokio-util/src/codec/mod.rs
+++ b/tokio-util/src/codec/mod.rs
@@ -18,6 +18,10 @@ pub use self::decoder::Decoder;
mod encoder;
pub use self::encoder::Encoder;
+mod framed_impl;
+#[allow(unused_imports)]
+pub(crate) use self::framed_impl::{FramedImpl, RWFrames, ReadFrame, WriteFrame};
+
mod framed;
pub use self::framed::{Framed, FramedParts};