/// An iterator that produces only the `T` values as long as the /// inner iterator produces `Ok(T)`. /// /// Used by [`process_results`](crate::process_results), see its docs /// for more information. #[must_use = "iterator adaptors are lazy and do nothing unless consumed"] #[derive(Debug)] pubstruct ProcessResults<'a, I, E: 'a> {
error: &'a mut Result<(), E>,
iter: I,
}
/// “Lift” a function of the values of an iterator so that it can process /// an iterator of `Result` values instead. /// /// [`IntoIterator`] enabled version of [`Itertools::process_results`]. pubfn process_results<I, F, T, E, R>(iterable: I, processor: F) -> Result<R, E> where
I: IntoIterator<Item = Result<T, E>>,
F: FnOnce(ProcessResults<I::IntoIter, E>) -> R,
{ let iter = iterable.into_iter(); letmut error = Ok(());
let result = processor(ProcessResults {
error: &mut error,
iter,
});
error.map(|_| result)
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.13 Sekunden
(vorverarbeitet am 2026-08-27)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.