[−][src]Crate asynchronous_codec
Utilities for encoding and decoding frames using async/await
.
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
.
use futures::TryStreamExt; use futures::io::Cursor; use asynchronous_codec::{LinesCodec, Framed}; let io = Cursor::new(Vec::new()); let mut framed = Framed::new(io, LinesCodec); while let Some(line) = framed.try_next().await? { dbg!(line); }
Structs
Bytes | A cheaply cloneable and sliceable chunk of contiguous memory. |
BytesCodec | A simple codec that ships bytes around |
BytesMut | A unique reference to a contiguous slice of memory. |
CborCodec | A codec for JSON encoding and decoding using serde_cbor Enc is the type to encode, Dec is the type to decode |
Framed | A unified |
FramedRead | A |
FramedWrite | A |
JsonCodec | A codec for JSON encoding and decoding using serde_json Enc is the type to encode, Dec is the type to decode |
LengthCodec | A simple |
LinesCodec | A simple |
Enums
CborCodecError | JSON Codec error enumeration |
JsonCodecError | JSON Codec error enumeration |
Traits
Decoder | Decoding of frames via buffers, for use with |
Encoder | Encoding of messages as bytes, for use with |