[−][src]Function gatherr::gatherr
pub fn gatherr<A, B, T: FromIterator<A>, E: FromIterator<B>, I: IntoIterator<Item = Result<A, B>>>(
iter: I
) -> Result<T, E>
Collect all Ok or Err values from an iterator into a single Result
of
collections
let v = vec![Ok("a"), Err(1), Ok("b"), Err(2)]; let result: Result<Vec<&str>, Vec<u32>> = gatherr(v); assert_eq!(result, Err(vec![1, 2]));