From 987ba7373cf95c570bf23768c6021f7a7508286e Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Sat, 26 Oct 2019 08:02:49 -0700 Subject: io: move into `tokio` crate (#1691) A step towards collapsing Tokio sub crates into a single `tokio` crate (#1318). The `io` implementation is now provided by the main `tokio` crate. Functionality can be opted out of by using the various net related feature flags. --- tokio-util/src/codec/decoder.rs | 2 +- tokio-util/src/codec/framed.rs | 2 +- tokio-util/src/codec/framed_read.rs | 2 +- tokio-util/src/codec/framed_write.rs | 2 +- tokio-util/src/codec/length_delimited.rs | 42 ++++++++++++++++---------------- 5 files changed, 25 insertions(+), 25 deletions(-) (limited to 'tokio-util/src/codec') diff --git a/tokio-util/src/codec/decoder.rs b/tokio-util/src/codec/decoder.rs index 720e0b6e..dfe5f8ee 100644 --- a/tokio-util/src/codec/decoder.rs +++ b/tokio-util/src/codec/decoder.rs @@ -1,7 +1,7 @@ use crate::codec::encoder::Encoder; use crate::codec::Framed; -use tokio_io::{AsyncRead, AsyncWrite}; +use tokio::io::{AsyncRead, AsyncWrite}; use bytes::BytesMut; use std::io; diff --git a/tokio-util/src/codec/framed.rs b/tokio-util/src/codec/framed.rs index e2eb82cb..8f2317f0 100644 --- a/tokio-util/src/codec/framed.rs +++ b/tokio-util/src/codec/framed.rs @@ -3,7 +3,7 @@ use crate::codec::encoder::Encoder; use crate::codec::framed_read::{framed_read2, framed_read2_with_buffer, FramedRead2}; use crate::codec::framed_write::{framed_write2, framed_write2_with_buffer, FramedWrite2}; -use tokio_io::{AsyncBufRead, AsyncRead, AsyncWrite}; +use tokio::io::{AsyncBufRead, AsyncRead, AsyncWrite}; use bytes::BytesMut; use futures_core::Stream; diff --git a/tokio-util/src/codec/framed_read.rs b/tokio-util/src/codec/framed_read.rs index 71f22150..6f79cb9a 100644 --- a/tokio-util/src/codec/framed_read.rs +++ b/tokio-util/src/codec/framed_read.rs @@ -1,7 +1,7 @@ use crate::codec::framed::Fuse; use crate::codec::Decoder; -use tokio_io::AsyncRead; +use tokio::io::AsyncRead; use bytes::BytesMut; use futures_core::Stream; diff --git a/tokio-util/src/codec/framed_write.rs b/tokio-util/src/codec/framed_write.rs index fa8aba17..3a95612c 100644 --- a/tokio-util/src/codec/framed_write.rs +++ b/tokio-util/src/codec/framed_write.rs @@ -2,7 +2,7 @@ use crate::codec::decoder::Decoder; use crate::codec::encoder::Encoder; use crate::codec::framed::Fuse; -use tokio_io::{AsyncBufRead, AsyncRead, AsyncWrite}; +use tokio::io::{AsyncBufRead, AsyncRead, AsyncWrite}; use bytes::BytesMut; use futures_core::{ready, Stream}; diff --git a/tokio-util/src/codec/length_delimited.rs b/tokio-util/src/codec/length_delimited.rs index 579417a2..df07466e 100644 --- a/tokio-util/src/codec/length_delimited.rs +++ b/tokio-util/src/codec/length_delimited.rs @@ -15,7 +15,7 @@ //! byte stream into a stream of frames. //! //! ``` -//! use tokio_io::{AsyncRead, AsyncWrite}; +//! use tokio::io::{AsyncRead, AsyncWrite}; //! use tokio_util::codec::{Framed, LengthDelimitedCodec}; //! //! fn bind_transport(io: T) @@ -78,7 +78,7 @@ //! frame head in the yielded `BytesMut`. //! //! ``` -//! # use tokio_io::AsyncRead; +//! # use tokio::io::AsyncRead; //! # use tokio_util::codec::LengthDelimitedCodec; //! # fn bind_read(io: T) { //! LengthDelimitedCodec::builder() @@ -112,7 +112,7 @@ //! frame head in the yielded `BytesMut`. //! //! ``` -//! # use tokio_io::AsyncRead; +//! # use tokio::io::AsyncRead; //! # use tokio_util::codec::LengthDelimitedCodec; //! # fn bind_read(io: T) { //! LengthDelimitedCodec::builder() @@ -144,7 +144,7 @@ //! **includes** the frame head length. //! //! ``` -//! # use tokio_io::AsyncRead; +//! # use tokio::io::AsyncRead; //! # use tokio_util::codec::LengthDelimitedCodec; //! # fn bind_read(io: T) { //! LengthDelimitedCodec::builder() @@ -178,7 +178,7 @@ //! frame head, including the frame head in the yielded `BytesMut`. //! //! ``` -//! # use tokio_io::AsyncRead; +//! # use tokio::io::AsyncRead; //! # use tokio_util::codec::LengthDelimitedCodec; //! # fn bind_read(io: T) { //! LengthDelimitedCodec::builder() @@ -222,7 +222,7 @@ //! included. //! //! ``` -//! # use tokio_io::AsyncRead; +//! # use tokio::io::AsyncRead; //! # use tokio_util::codec::LengthDelimitedCodec; //! # fn bind_read(io: T) { //! LengthDelimitedCodec::builder() @@ -268,7 +268,7 @@ //! length. //! //! ``` -//! # use tokio_io::AsyncRead; +//! # use tokio::io::AsyncRead; //! # use tokio_util::codec::LengthDelimitedCodec; //! # fn bind_read(io: T) { //! LengthDelimitedCodec::builder() @@ -313,7 +313,7 @@ //! configuration: //! //! ``` -//! # use tokio_io::AsyncWrite; +//! # use tokio::io::AsyncWrite; //! # use tokio_util::codec::LengthDelimitedCodec; //! # fn write_frame(io: T) { //! # let _ = @@ -342,7 +342,7 @@ use crate::codec::{Decoder, Encoder, Framed, FramedRead, FramedWrite}; -use tokio_io::{AsyncRead, AsyncWrite}; +use tokio::io::{AsyncRead, AsyncWrite}; use bytes::{Buf, BufMut, Bytes, BytesMut, IntoBuf}; use std::error::Error as StdError; @@ -605,7 +605,7 @@ impl Builder { /// # Examples /// /// ``` - /// # use tokio_io::AsyncRead; + /// # use tokio::io::AsyncRead; /// use tokio_util::codec::LengthDelimitedCodec; /// /// # fn bind_read(io: T) { @@ -649,7 +649,7 @@ impl Builder { /// # Examples /// /// ``` - /// # use tokio_io::AsyncRead; + /// # use tokio::io::AsyncRead; /// use tokio_util::codec::LengthDelimitedCodec; /// /// # fn bind_read(io: T) { @@ -673,7 +673,7 @@ impl Builder { /// # Examples /// /// ``` - /// # use tokio_io::AsyncRead; + /// # use tokio::io::AsyncRead; /// use tokio_util::codec::LengthDelimitedCodec; /// /// # fn bind_read(io: T) { @@ -697,7 +697,7 @@ impl Builder { /// # Examples /// /// ``` - /// # use tokio_io::AsyncRead; + /// # use tokio::io::AsyncRead; /// use tokio_util::codec::LengthDelimitedCodec; /// /// # fn bind_read(io: T) { @@ -731,7 +731,7 @@ impl Builder { /// # Examples /// /// ``` - /// # use tokio_io::AsyncRead; + /// # use tokio::io::AsyncRead; /// use tokio_util::codec::LengthDelimitedCodec; /// /// # fn bind_read(io: T) { @@ -755,7 +755,7 @@ impl Builder { /// # Examples /// /// ``` - /// # use tokio_io::AsyncRead; + /// # use tokio::io::AsyncRead; /// use tokio_util::codec::LengthDelimitedCodec; /// /// # fn bind_read(io: T) { @@ -778,7 +778,7 @@ impl Builder { /// # Examples /// /// ``` - /// # use tokio_io::AsyncRead; + /// # use tokio::io::AsyncRead; /// use tokio_util::codec::LengthDelimitedCodec; /// /// # fn bind_read(io: T) { @@ -799,7 +799,7 @@ impl Builder { /// # Examples /// /// ``` - /// # use tokio_io::AsyncRead; + /// # use tokio::io::AsyncRead; /// use tokio_util::codec::LengthDelimitedCodec; /// /// # fn bind_read(io: T) { @@ -823,7 +823,7 @@ impl Builder { /// # Examples /// /// ``` - /// # use tokio_io::AsyncRead; + /// # use tokio::io::AsyncRead; /// use tokio_util::codec::LengthDelimitedCodec; /// /// # fn bind_read(io: T) { @@ -865,7 +865,7 @@ impl Builder { /// # Examples /// /// ``` - /// # use tokio_io::AsyncRead; + /// # use tokio::io::AsyncRead; /// use tokio_util::codec::LengthDelimitedCodec; /// /// # fn bind_read(io: T) { @@ -890,7 +890,7 @@ impl Builder { /// # Examples /// /// ``` - /// # use tokio_io::AsyncWrite; + /// # use tokio::io::AsyncWrite; /// # use tokio_util::codec::LengthDelimitedCodec; /// # fn write_frame(io: T) { /// LengthDelimitedCodec::builder() @@ -911,7 +911,7 @@ impl Builder { /// # Examples /// /// ``` - /// # use tokio_io::{AsyncRead, AsyncWrite}; + /// # use tokio::io::{AsyncRead, AsyncWrite}; /// # use tokio_util::codec::LengthDelimitedCodec; /// # fn write_frame(io: T) { /// # let _ = -- cgit v1.2.3