[][src]Trait vecfold::VecFoldResult

pub trait VecFoldResult<'a, T, E> where
    T: Debug,
    E: Error + Debug + 'a, 
{ fn foldr(&self) -> Result<Vec<&T>, &E>; }

Required methods

fn foldr(&self) -> Result<Vec<&T>, &E>

Loading content...

Implementations on Foreign Types

impl<'a, T, E> VecFoldResult<'a, T, E> for Vec<Result<T, E>> where
    T: Debug,
    E: Error + Debug + 'a, 
[src]

Converts Vec<Result<T, E>> to Result<Vec<&T>, &E> stopping on first error

If no error is found Vec<&T> foldr is equivalent of Ok(v.map(|x| x.as_ref().unwrap())) If an error is found, the first error is returned and the vector is not walked further

Loading content...

Implementors

Loading content...