Iterable

Trait Iterable 

Source
pub trait Iterable<K: Kind> {
    type Iter: Iterator;

    // Required method
    fn iter(&self) -> Self::Iter;
}
Available on (crate features list or struct) and crate feature instant only.
Expand description

Trait used to generalize over IntoIterator+Copy and Iterator+Clone types. Actual used source is defined via type parameter which should implement Kind trait. There can be some problems when type implements Iterator and Copy simultaneously: since every Iterator automatically implements IntoIterator, and Copy implementation requires Clone implementation too, such type will suit both alternatives and will cause conflict until explicit Kind specified. Trait is not sealed, so any user can define own Iterable implementation.

Required Associated Types§

Required Methods§

Source

fn iter(&self) -> Self::Iter

Implementors§

Source§

impl<T: IntoIterator + Copy> Iterable<Source> for T

Implementation of Iterable for IntoIterator+Copy types - mostly for references onto IntoIterator types.

Source§

impl<T: Iterator + Clone> Iterable<Passage> for T

Implementation of Iterable for Iterator+Clone types.

Source§

type Iter = T