[][src]Trait dencode::IterSinkExt

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

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

Provided methods

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

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.

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

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.

Loading content...

Implementors

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

Loading content...