Create tokio-codec (#360)

Create a new tokio-codec crate with many of the contents of
`tokio_io::codec`.
This commit is contained in:
Bryan Burgers
2018-06-04 20:36:06 -07:00
committed by Carl Lerche
parent 3d7263d3a0
commit f723d10087
42 changed files with 1100 additions and 23 deletions
+4 -3
View File
@@ -55,9 +55,10 @@
#![deny(warnings)]
extern crate tokio;
extern crate tokio_codec;
extern crate tokio_io;
use tokio_io::codec::BytesCodec;
use tokio_codec::{Decoder, BytesCodec};
use tokio::net::TcpListener;
use tokio::prelude::*;
@@ -99,8 +100,8 @@ fn main() {
// We're parsing each socket with the `BytesCodec` included in `tokio_io`,
// and then we `split` each codec into the reader/writer halves.
//
// See https://docs.rs/tokio-io/0.1/src/tokio_io/codec/bytes_codec.rs.html
let framed = socket.framed(BytesCodec::new());
// See https://docs.rs/tokio-codec/0.1/src/tokio_codec/bytes_codec.rs.html
let framed = BytesCodec::new().framed(socket);
let (_writer, reader) = framed.split();
let processor = reader