Skip to main content

IterableFn

Trait IterableFn 

Source
pub trait IterableFn {
    type Item;

    // Required method
    fn call(&mut self) -> Option<Self::Item>;
}
Expand description

Trait for types that can produce optional values, used by Iterable.

Implemented for FnMut() -> Option<T> and Iterator<Item = T>, allowing Iterable to wrap both closures and iterators uniformly. External users can implement this trait for custom iteration sources.

Required Associated Types§

Required Methods§

Source

fn call(&mut self) -> Option<Self::Item>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§