operon 0.7.0

A workflow engine for parallel, incremental scheduling of DAG-defined multiplex tasks.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/// Splitting an iterator into its first item and the rest, by value.
pub(crate) trait SplitFirstOwned<T> {
    /// The first item and everything after it, or `None` when there is no first item.
    fn split_first_owned(self) -> Option<(T, Vec<T>)>;
}

impl<T, I: IntoIterator<Item = T>> SplitFirstOwned<T> for I {
    fn split_first_owned(self) -> Option<(T, Vec<T>)> {
        let mut iter = self.into_iter();

        let first = iter.next()?;
        let rest: Vec<T> = iter.collect();
        Some((first, rest))
    }
}