mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-21 00:00:10 +02:00
Introduces `StreamExt` trait. This trait will be used to add utility functions to make working with streams easier. This patch includes two functions: * `next`: a future returning the item in the stream. * `map`: transform each item in the stream.
35 lines
1.0 KiB
Rust
35 lines
1.0 KiB
Rust
//! Utilities for encoding and decoding frames.
|
|
//!
|
|
//! Contains adapters to go from streams of bytes, [`AsyncRead`] and
|
|
//! [`AsyncWrite`], to framed streams implementing [`Sink`] and [`Stream`].
|
|
//! Framed streams are also known as transports.
|
|
//!
|
|
//! [`AsyncRead`]: https://docs.rs/tokio/*/tokio/io/trait.AsyncRead.html
|
|
//! [`AsyncWrite`]: https://docs.rs/tokio/*/tokio/io/trait.AsyncWrite.html
|
|
//! [`Stream`]: https://docs.rs/tokio/*/tokio/stream/trait.Stream.html
|
|
//! [`Sink`]: https://docs.rs/futures-sink/*/futures_sink/trait.Sink.html
|
|
|
|
mod bytes_codec;
|
|
pub use self::bytes_codec::BytesCodec;
|
|
|
|
mod decoder;
|
|
pub use self::decoder::Decoder;
|
|
|
|
mod encoder;
|
|
pub use self::encoder::Encoder;
|
|
|
|
mod framed;
|
|
pub use self::framed::{Framed, FramedParts};
|
|
|
|
mod framed_read;
|
|
pub use self::framed_read::FramedRead;
|
|
|
|
mod framed_write;
|
|
pub use self::framed_write::FramedWrite;
|
|
|
|
pub mod length_delimited;
|
|
pub use self::length_delimited::{LengthDelimitedCodec, LengthDelimitedCodecError};
|
|
|
|
mod lines_codec;
|
|
pub use self::lines_codec::{LinesCodec, LinesCodecError};
|