pub fn add_batches<'a, I: IntoIterator<Item = &'a Batch>>(
        &mut self,
        batches: I,
    ) -> Result<bool, ValidationRuleEnforcerError> {
        if self.rules.is_empty() {
            return Ok(true);
        }

        // Pull the transaction info out of the batches
        let mut txn_info = batches
            .into_iter()
            .flat_map(|batch| batch.transactions())
            .cloned()
            .map(TxnInfo::try_from)
            .collect::<Result<Vec<_>, _>>()?;

        // Validate the old + new transaction info; store the transaction info if valid.
        let is_valid = self.rules.iter().all(|rule| {
            rule.validate(
                self.txn_info.iter().chain(txn_info.iter()),
                &self.local_signer_key,
                false,
            )
        });
        if is_valid {
            self.txn_info.append(&mut txn_info);
        }

        Ok(is_valid)
    }
/// Checks if the given batches, combined with those already added to the
/// `ValidationRuleEnforcer`, follow the rules. If the batches follow the rules, they are saved
/// by the `ValidationRuleEnforcer`.
///
/// If not enough batches/transactions have been added to verify rules based on the position of
/// batches/transactions, those rules are ignored when validating the batches.
Checks if the given batches, combined with those already added to the
`ValidationRuleEnforcer`, follow the rules. If the batches follow the rules, they are saved
by the `ValidationRuleEnforcer`.

If not enough batches/transactions have been added to verify rules based on the position of
batches/transactions, those rules are ignored when validating the batches.
Checks if the given batches combined with those already added to the ` ValidationRuleEnforcer ` follow the rules . If the batches follow the rules they are saved by the ` ValidationRuleEnforcer ` . If not enough batches / transactions have been added to verify rules based on the position of batches / transactions those rules are ignored when validating the batches .
pub fn add_batches<'a, I: IntoIterator<Item = &'a Batch>>(
        &mut self,
        batches: I,
    ) -> Result<bool, ValidationRuleEnforcerError> {
        if self.rules.is_empty() {
            return Ok(true);
        }
        // Pull the transaction info out of the batches
        let mut txn_info = batches
            .into_iter()
            .flat_map(|batch| batch.transactions())
            .cloned()
            .map(TxnInfo::try_from)
            .collect::<Result<Vec<_>, _>>()?;
        // Validate the old + new transaction info; store the transaction info if valid.
        let is_valid = self.rules.iter().all(|rule| {
            rule.validate(
                self.txn_info.iter().chain(txn_info.iter()),
                &self.local_signer_key,
                false,
            )
        });
        if is_valid {
            self.txn_info.append(&mut txn_info);
        }
        Ok(is_valid)
    }
pub fn add_batches < ' a , I : IntoIterator < Item = & ' a Batch > > ( & mut self , batches : I , ) -> Result < bool , ValidationRuleEnforcerError > { if self . rules . is_empty ( ) { return Ok ( true ) ; } // Pull the transaction info out of the batches let mut txn_info = batches . into_iter ( ) . flat_map ( | batch | batch . transactions ( ) ) . cloned ( ) . map ( TxnInfo :: try_from ) . collect :: < Result < Vec < _ > , _ > > ( ) ? ; // Validate the old + new transaction info; store the transaction info if valid. let is_valid = self . rules . iter ( ) . all ( | rule | { rule . validate ( self . txn_info . iter ( ) . chain ( txn_info . iter ( ) ) , & self . local_signer_key , false , ) } ) ; if is_valid { self . txn_info . append ( & mut txn_info ) ; } Ok ( is_valid ) }
Checks if the given batches, combined with those already added to the
`ValidationRuleEnforcer`, follow the rules.
Checks if the given batches combined with those already added to the ` ValidationRuleEnforcer ` follow the rules .
&mut self
batches
I
&mut self
batches
I