Struct dencode::LinesCodec [−][src]
pub struct LinesCodec {}
Expand description
A simple Codec
implementation that splits up data into lines.
use dencode::{FramedRead, LinesCodec}; use futures::stream::TryStreamExt; // for lines.try_next() 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 Clone for LinesCodec
[src]
impl Clone for LinesCodec
[src]fn clone(&self) -> LinesCodec
[src]
fn clone(&self) -> LinesCodec
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl Debug for LinesCodec
[src]
impl Debug for LinesCodec
[src]impl Decoder for LinesCodec
[src]
impl Decoder for LinesCodec
[src]impl Encoder<String> for LinesCodec
[src]
impl Encoder<String> for LinesCodec
[src]impl Copy for LinesCodec
[src]
Auto Trait Implementations
impl RefUnwindSafe for LinesCodec
impl Send for LinesCodec
impl Sync for LinesCodec
impl Unpin for LinesCodec
impl UnwindSafe for LinesCodec
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more