Trait dencode::IterSinkExt[][src]

pub trait IterSinkExt<Item>: IterSink<Item> {
    fn send(&mut self, item: Item) -> Result<(), Self::Error> { ... }
fn send_all<I>(&mut self, items: I) -> Result<(), Self::Error>
    where
        I: IntoIterator<Item = Result<Item, Self::Error>>
, { ... } }
Expand description

An extension trait for IterSinks that provides a few convenient functions.

Provided methods

fn send(&mut self, item: Item) -> Result<(), Self::Error>[src]

Expand description

Fully processed an item into the sink, including flushing.

Note that, because of the flushing requirement, it is usually better to batch together items to send via send_all, rather than flushing between each item.

fn send_all<I>(&mut self, items: I) -> Result<(), Self::Error> where
    I: IntoIterator<Item = Result<Item, Self::Error>>, 
[src]

Expand description

Fully process the iterator of items into the sink, including flushing.

This will drive the iterator to keep producing items until it is exhausted, sending each item to the sink. It will complete once both the input iterator is exhausted, and the sink has received and flushed all items.

Implementors

impl<T: ?Sized, Item> IterSinkExt<Item> for T where
    T: IterSink<Item>, 
[src]