Move tokio_io::codec::length_delimited module to tokio::codec (#568)

* Deprecate tokio-io::length_delimited
* Move `length_delimited` into `tokio::codec`

Signed-off-by: Eliza Weisman <[email protected]>
This commit is contained in:
Eliza Weisman
2018-08-24 15:54:42 -04:00
committed by Toby Lawrence
parent 07203408de
commit 2e88e29fe9
5 changed files with 1303 additions and 1 deletions
+2
View File
@@ -32,6 +32,8 @@ pub use framed::{Framed, FramedParts};
pub use framed_read::FramedRead;
pub use framed_write::FramedWrite;
#[deprecated(since = "0.1.8", note = "Moved to tokio-codec")]
#[doc(hidden)]
pub mod length_delimited {
//! Frame a stream of bytes based on a length prefix
//!
+10
View File
@@ -16,6 +16,8 @@ use std::io::{self, Cursor};
/// `Builder` enables constructing configured length delimited framers. Note
/// that not all configuration settings apply to both encoding and decoding. See
/// the documentation for specific methods for more detail.
#[deprecated(since = "0.1.8", note = "Moved to tokio-codec")]
#[doc(hidden)]
#[derive(Debug, Clone, Copy)]
pub struct Builder {
// Maximum frame length
@@ -44,6 +46,8 @@ pub struct Builder {
/// See [module level] documentation for more detail.
///
/// [module level]: index.html
#[deprecated(since = "0.1.8", note = "Moved to tokio-codec")]
#[doc(hidden)]
pub struct Framed<T, B: IntoBuf = BytesMut> {
inner: FramedRead<FramedWrite<T, B>>,
}
@@ -53,12 +57,16 @@ pub struct Framed<T, B: IntoBuf = BytesMut> {
/// See [module level] documentation for more detail.
///
/// [module level]: index.html
#[deprecated(since = "0.1.8", note = "Moved to tokio-codec")]
#[doc(hidden)]
#[derive(Debug)]
pub struct FramedRead<T> {
inner: codec::FramedRead<T, Decoder>,
}
/// An error when the number of bytes read is more than max frame length.
#[deprecated(since = "0.1.8", note = "Moved to tokio-codec")]
#[doc(hidden)]
pub struct FrameTooBig {
_priv: (),
}
@@ -83,6 +91,8 @@ enum DecodeState {
/// See [module level] documentation for more detail.
///
/// [module level]: index.html
#[deprecated(since = "0.1.8", note = "Moved to tokio-codec")]
#[doc(hidden)]
pub struct FramedWrite<T, B: IntoBuf = BytesMut> {
// I/O type
inner: T,