/// Apply the given [Transaction] object to this [RewriteManager] iff no other
/// [RewriteRuleStates] have been applied since `transaction` was cloned from this
/// [RewriteManager].
Apply the given [Transaction] object to this [RewriteManager] iff no other
[RewriteRuleStates] have been applied since `transaction` was cloned from this
[RewriteManager].
Apply the given [ Transaction ] object to this [ RewriteManager ] iff no other [ RewriteRuleStates ] have been applied since ` transaction ` was cloned from this [ RewriteManager ] .
pub fn apply(&mut self, transaction: Transaction) -> Result<(), CommitError> {
        if let Some(ref dynamic_rules_path) = self.dynamic_rules_path {
            if self.generation != transaction.generation {
                Err(CommitError::TooLate)
            } else {
                self.dynamic_rules = transaction.dynamic_rules.into();
                self.generation += 1;
                // FIXME(kevinwells) synchronous I/O in an async context
                if let Err(err) = Self::save(&mut self.dynamic_rules, dynamic_rules_path) {
                    fx_log_err!("error while saving dynamic rewrite rules: {}", err);
                }
                self.update_inspect_objects();
                Ok(())
            }
        } else {
            Err(CommitError::DynamicConfigurationDisabled)
        }
    }
pub fn apply ( & mut self , transaction : Transaction ) -> Result < ( ) , CommitError > { if let Some ( ref dynamic_rules_path ) = self . dynamic_rules_path { if self . generation != transaction . generation { Err ( CommitError :: TooLate ) } else { self . dynamic_rules = transaction . dynamic_rules . into ( ) ; self . generation += 1 ; // FIXME(kevinwells) synchronous I/O in an async context if let Err ( err ) = Self :: save ( & mut self . dynamic_rules , dynamic_rules_path ) { fx_log_err ! ( " " err ) ; } self . update_inspect_objects ( ) ; Ok ( ( ) ) } } else { Err ( CommitError :: DynamicConfigurationDisabled ) } }
Apply the given [Transaction] object to this [RewriteManager] iff no other
[RewriteRuleStates] have been applied since `transaction` was cloned from this
[RewriteManager].
Apply the given [ Transaction ] object to this [ RewriteManager ] iff no other [ RewriteRuleStates ] have been applied since ` transaction ` was cloned from this [ RewriteManager ] .
&mut self
transaction
Transaction