Trait Splittable

Source
pub trait Splittable<I>
where I: Iterator,
{ // Required method fn split<P>(self, predicate: P) -> (Split<I, P>, Split<I, P>) where P: FnMut(&I::Item) -> bool; }
Expand description

Provides an iterator adaptor method that splits an iterator into two iterators according to a predicate.

Required Methods§

Source

fn split<P>(self, predicate: P) -> (Split<I, P>, Split<I, P>)
where P: FnMut(&I::Item) -> bool,

Splits the iterator. The left iterator iterates over all items for which the predicate returns false. The right iterator returns all items for which the predicate returns true.

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.

Implementors§

Source§

impl<I> Splittable<I> for I
where I: Iterator,