pub fn apply<Err, Func>(mut self, func: Func) -> BatchResult<T>
  where
    Func: Fn(&mut T) -> Result<(), Err>,
    Err: Into<AnyhowError> + Display + Debug + Send + Sync + 'static,
  {
    self.count += 1;
    let res = func(&mut self.value);
    if let Err(err) = res {
      self.append(err);
    }
    self
  }
/// Uses a function to apply each item to the accumulator, storing errors for future examination
///
/// Please note, errors have the potential to corrupt the accumulator since it mutates
Uses a function to apply each item to the accumulator, storing errors for future examination
Please note, errors have the potential to corrupt the accumulator since it mutates
Uses a function to apply each item to the accumulator storing errors for future examination Please note errors have the potential to corrupt the accumulator since it mutates
pub fn apply<Err, Func>(mut self, func: Func) -> BatchResult<T>
  where
    Func: Fn(&mut T) -> Result<(), Err>,
    Err: Into<AnyhowError> + Display + Debug + Send + Sync + 'static,
  {
    self.count += 1;
    let res = func(&mut self.value);
    if let Err(err) = res {
      self.append(err);
    }
    self
  }
pub fn apply < Err , Func > ( mut self , func : Func ) -> BatchResult < T > where Func : Fn ( & mut T ) -> Result < ( ) , Err > , Err : Into < AnyhowError > + Display + Debug + Send + Sync + ' static , { self . count += 1 ; let res = func ( & mut self . value ) ; if let Err ( err ) = res { self . append ( err ) ; } self }
Uses a function to apply each item to the accumulator, storing errors for future examination
Please note, errors have the potential to corrupt the accumulator since it mutates
Uses a function to apply each item to the accumulator storing errors for future examination Please note errors have the potential to corrupt the accumulator since it mutates
mut self
func
Func
mut self
func
Func