pub struct RulePromoter { /* private fields */ }Expand description
Manages rule promotion from project to global scope
Implementations§
Source§impl RulePromoter
impl RulePromoter
Sourcepub fn request_promotion(
&mut self,
rule: Rule,
global_rules: &[Rule],
) -> Result<RuleReview>
pub fn request_promotion( &mut self, rule: Rule, global_rules: &[Rule], ) -> Result<RuleReview>
Request promotion of a rule from project to global scope
Sourcepub fn approve_promotion(
&mut self,
rule_id: &str,
reason: Option<String>,
) -> Result<Rule>
pub fn approve_promotion( &mut self, rule_id: &str, reason: Option<String>, ) -> Result<Rule>
Approve a pending promotion
Sourcepub fn reject_promotion(
&mut self,
rule_id: &str,
reason: Option<String>,
) -> Result<()>
pub fn reject_promotion( &mut self, rule_id: &str, reason: Option<String>, ) -> Result<()>
Reject a pending promotion
Sourcepub fn get_pending_promotion(&self, rule_id: &str) -> Result<RuleReview>
pub fn get_pending_promotion(&self, rule_id: &str) -> Result<RuleReview>
Get a pending promotion for review
Sourcepub fn get_pending_promotions(&self) -> Vec<RuleReview>
pub fn get_pending_promotions(&self) -> Vec<RuleReview>
Get all pending promotions
Sourcepub fn pending_promotion_count(&self) -> usize
pub fn pending_promotion_count(&self) -> usize
Get the number of pending promotions
Sourcepub fn get_promotion_history(&self) -> Vec<PromotionHistoryEntry>
pub fn get_promotion_history(&self) -> Vec<PromotionHistoryEntry>
Get promotion history
Sourcepub fn get_promotion_history_for_rule(
&self,
rule_id: &str,
) -> Vec<PromotionHistoryEntry>
pub fn get_promotion_history_for_rule( &self, rule_id: &str, ) -> Vec<PromotionHistoryEntry>
Get promotion history for a specific rule
Sourcepub fn get_promotion_history_for_scope(
&self,
source_scope: RuleScope,
target_scope: RuleScope,
) -> Vec<PromotionHistoryEntry>
pub fn get_promotion_history_for_scope( &self, source_scope: RuleScope, target_scope: RuleScope, ) -> Vec<PromotionHistoryEntry>
Get promotion history for a specific scope
Sourcepub fn get_approved_promotions(&self) -> Vec<PromotionHistoryEntry>
pub fn get_approved_promotions(&self) -> Vec<PromotionHistoryEntry>
Get approved promotions from history
Sourcepub fn get_rejected_promotions(&self) -> Vec<PromotionHistoryEntry>
pub fn get_rejected_promotions(&self) -> Vec<PromotionHistoryEntry>
Get rejected promotions from history
Sourcepub fn validate_promotion(
&self,
promoted_rule: &Rule,
global_rules: &[Rule],
) -> Result<()>
pub fn validate_promotion( &self, promoted_rule: &Rule, global_rules: &[Rule], ) -> Result<()>
Validate a promoted rule against global rules
Sourcepub fn compare_versions(previous: &Rule, current: &Rule) -> VersionChanges
pub fn compare_versions(previous: &Rule, current: &Rule) -> VersionChanges
Compare two versions of a rule
Sourcepub fn create_review_with_comparison(
rule: Rule,
previous_version: Option<Rule>,
global_rules: &[Rule],
) -> Result<RuleReview>
pub fn create_review_with_comparison( rule: Rule, previous_version: Option<Rule>, global_rules: &[Rule], ) -> Result<RuleReview>
Create a rule review with version comparison
Sourcepub fn clear_pending_promotions(&mut self)
pub fn clear_pending_promotions(&mut self)
Clear all pending promotions
Sourcepub fn clear_promotion_history(&mut self)
pub fn clear_promotion_history(&mut self)
Clear promotion history
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RulePromoter
impl RefUnwindSafe for RulePromoter
impl Send for RulePromoter
impl Sync for RulePromoter
impl Unpin for RulePromoter
impl UnwindSafe for RulePromoter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more