mirror of https://github.com/fafhrd91/actix-net
Update actix-codec to tokio 0.2
This commit is contained in:
parent
c254bb978c
commit
5cb5fdf499
|
@ -18,9 +18,9 @@ name = "actix_codec"
|
||||||
path = "src/lib.rs"
|
path = "src/lib.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
bytes = "0.4.12"
|
bytes = "0.5"
|
||||||
futures = "0.3.1"
|
futures = "0.3.1"
|
||||||
pin-project = "0.4.5"
|
pin-project = "0.4.5"
|
||||||
tokio-io = "0.2.0-alpha.6"
|
tokio = { version = "0.2", features = ["io-std", "io-util"] }
|
||||||
tokio-codec = "0.2.0-alpha.6"
|
tokio-util = { version = "0.2", features = ["codec"] }
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use std::io;
|
use std::io;
|
||||||
|
|
||||||
use bytes::{Bytes, BytesMut};
|
use bytes::{Bytes, BytesMut};
|
||||||
use tokio_codec::{Decoder, Encoder};
|
use tokio_util::codec::{Decoder, Encoder};
|
||||||
|
|
||||||
/// Bytes codec.
|
/// Bytes codec.
|
||||||
///
|
///
|
||||||
|
@ -27,7 +27,7 @@ impl Decoder for BytesCodec {
|
||||||
if src.is_empty() {
|
if src.is_empty() {
|
||||||
Ok(None)
|
Ok(None)
|
||||||
} else {
|
} else {
|
||||||
Ok(Some(src.take()))
|
Ok(Some(src.split()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,8 +8,8 @@ use std::task::{Context, Poll};
|
||||||
use bytes::BytesMut;
|
use bytes::BytesMut;
|
||||||
use futures::{ready, Sink, Stream};
|
use futures::{ready, Sink, Stream};
|
||||||
use pin_project::pin_project;
|
use pin_project::pin_project;
|
||||||
use tokio_codec::{Decoder, Encoder};
|
use tokio_util::codec::{Decoder, Encoder};
|
||||||
use tokio_io::{AsyncRead, AsyncWrite};
|
use tokio::io::{AsyncRead, AsyncWrite};
|
||||||
|
|
||||||
const LW: usize = 1024;
|
const LW: usize = 1024;
|
||||||
const HW: usize = 8 * 1024;
|
const HW: usize = 8 * 1024;
|
||||||
|
|
|
@ -16,5 +16,5 @@ mod framed;
|
||||||
pub use self::bcodec::BytesCodec;
|
pub use self::bcodec::BytesCodec;
|
||||||
pub use self::framed::{Framed, FramedParts};
|
pub use self::framed::{Framed, FramedParts};
|
||||||
|
|
||||||
pub use tokio_codec::{Decoder, Encoder};
|
pub use tokio_util::codec::{Decoder, Encoder};
|
||||||
pub use tokio_io::{AsyncRead, AsyncWrite};
|
pub use tokio::io::{AsyncRead, AsyncWrite};
|
||||||
|
|
Loading…
Reference in New Issue