pub trait IterableByValue {
type Item;
type Iter<'a>: Iterator<Item = Self::Item>
where Self: 'a;
// Required method
fn iter_value(&self) -> Self::Iter<'_>;
}Expand description
A trait for obtaining a value-based iterator.
This trait necessary as all standard Rust containers already have
IntoIterator-based methods for obtaining reference-based iterators.
Note that iter_value returns a standard
iterator. However, the intended semantics is that the iterator will return
values.
If you need to iterate from a given position, and you can implement such
an iterator more efficiently, please consider IterableByValueFrom.
Required Associated Types§
Required Methods§
Sourcefn iter_value(&self) -> Self::Iter<'_>
fn iter_value(&self) -> Self::Iter<'_>
Returns an iterator on values.
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.