fn try_continue<F, R>(self, f: F) -> Result<R, E>
    where
        Self: Sized,
        F: FnOnce(&mut TryContinueIter<Self, E>) -> R,
    {
        let mut iter = TryContinueIter::new(self);
        let iteration_output = f(&mut iter);
        iter.err.map_or(Ok(iteration_output), Err)
    }
/// Allows one to continue processing an iterator of `Result<T, _>`, as if it were
/// a `Result<T>`, provided that all of the elements are `Ok`. The iterator will
/// short-circuit if an `Err` element is encountered.
///
/// This is particularly useful if you need to map to a fallible function, and would
/// like to continue using the iterator API to process the elements, but still know if
/// the mapped function fails.
///
/// # Errors
/// The `Result` will only return an error if the given function returns one.
///
/// # Examples
///
/// ```
/// use try_continue::TryContinue;
///
/// let elements = vec!["1", "2", "3", "4"];
/// let total = elements
///     .into_iter()
///     .map(str::parse::<u8>)
///     .try_continue(|iter| iter.sum());
///
/// assert_eq!(10_u8, total.unwrap());
/// ```
///
/// ```
/// use try_continue::TryContinue;
///
/// let elements = vec!["1", "2", "three", "4"];
/// let total = elements
///     .into_iter()
///     .map(str::parse::<u8>)
///     .try_continue(|iter| iter.sum::<u8>());
///
/// assert!(total.is_err());
/// ```


This is particularly useful if you need to map to a fallible function, and would
like to continue using the iterator API to process the elements, but still know if
the mapped function fails.
This is particularly useful if you need to map to a fallible function and would like to continue using the iterator API to process the elements but still know if the mapped function fails .
fn try_continue<F, R>(self, f: F) -> Result<R, E>
    where
        Self: Sized,
        F: FnOnce(&mut TryContinueIter<Self, E>) -> R,
    {
        let mut iter = TryContinueIter::new(self);
        let iteration_output = f(&mut iter);
        iter.err.map_or(Ok(iteration_output), Err)
    }
fn try_continue < F , R > ( self , f : F ) -> Result < R , E > where Self : Sized , F : FnOnce ( & mut TryContinueIter < Self , E > ) -> R , { let mut iter = TryContinueIter :: new ( self ) ; let iteration_output = f ( & mut iter ) ; iter . err . map_or ( Ok ( iteration_output ) , Err ) }
Allows one to continue processing an iterator of `Result<T, _>`, as if it were
a `Result<T>`, provided that all of the elements are `Ok`.
Allows one to continue processing an iterator of ` Result<T _ > ` as if it were a ` Result<T > ` provided that all of the elements are ` Ok ` .
self
f
F
self
f
F
errors
The `Result` will only return an error if the given function returns one.
The ` Result ` will only return an error if the given function returns one .
examples
```
use try_continue::TryContinue.





```
use try_continue::TryContinue.




` ` ` use try_continue :: TryContinue . ` ` ` use try_continue :: TryContinue .