Skip to main content

PatternRule

Trait PatternRule 

Source
pub trait PatternRule: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn matches(&self, scenario: &MergeScenario<&str>) -> bool;
    fn resolve(&self, scenario: &MergeScenario<&str>) -> String;
    fn confidence(&self) -> Confidence;
}
Expand description

A pattern rule that can match and resolve a conflict.

Required Methods§

Source

fn name(&self) -> &str

Human-readable name for the rule.

Source

fn matches(&self, scenario: &MergeScenario<&str>) -> bool

Check if this rule matches the given conflict scenario.

Source

fn resolve(&self, scenario: &MergeScenario<&str>) -> String

Produce a resolution. Only called if matches returned true.

Source

fn confidence(&self) -> Confidence

Confidence level of this rule’s resolution.

Implementors§