pub trait IterSinkExt<Item>: IterSink<Item> {
// Provided methods
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§
Sourcefn send(&mut self, item: Item) -> Result<(), Self::Error>
fn send(&mut self, item: Item) -> Result<(), Self::Error>
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.
Sourcefn send_all<I>(&mut self, items: I) -> Result<(), Self::Error>
fn send_all<I>(&mut self, items: I) -> Result<(), Self::Error>
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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.