[][src]Trait ritual_common::utils::MapIfOk

pub trait MapIfOk<A> {
    fn map_if_ok<B, E, F: FnMut(A) -> Result<B, E>>(
        self,
        f: F
    ) -> Result<Vec<B>, E>; }

Perform a map operation that can fail

Required methods

fn map_if_ok<B, E, F: FnMut(A) -> Result<B, E>>(self, f: F) -> Result<Vec<B>, E>

Call closure f on each element of the collection and return Vec of values returned by the closure. If closure returns Err at some iteration, return that Err instead.

Loading content...

Implementors

impl<A, T: IntoIterator<Item = A>> MapIfOk<A> for T[src]

Loading content...