Trait dispose::DisposeIterator
source · pub trait DisposeIterator {
// Required method
fn dispose_iter(self);
}
Expand description
A helper trait for iterators with items implementing Dispose
.
This trait exists mainly because of the stringency of Rust’s trait solver
— implementing Dispose
for all I: IntoIterator
with I::Item: Dispose
causes conflicts with the other blanket implementations of
Dispose
, so this trait serves as a replacement.
Several types with DisposeIterator
implementations (such as Vec<T>
)
have dedicated Dispose
implementations for convenience.
Required Methods§
sourcefn dispose_iter(self)
fn dispose_iter(self)
Dispose all items in the iterator, consuming it.