Struct asynchronous_codec::LinesCodec [−][src]
pub struct LinesCodec;
A simple Codec
implementation that splits up data into lines.
use futures::stream::TryStreamExt; // for lines.try_next() use asynchronous_codec::{FramedRead, LinesCodec}; let input = "hello\nworld\nthis\nis\ndog\n".as_bytes(); let mut lines = FramedRead::new(input, LinesCodec); while let Some(line) = lines.try_next().await? { println!("{}", line); }
Trait Implementations
impl Decoder for LinesCodec
[src]
impl Decoder for LinesCodec
[src]