pub struct TriMatching { /* private fields */ }Expand description
Matching between a base and two branch trees.
This struct coordinates the matching process for 3-way merge:
- Matches the right branch against the base tree
- Swaps left/right matchings in base nodes (so right matchings become “right”)
- Matches the left branch against the base tree
- Sets up partner relationships so each branch node knows its partners in the other branch
Implementations§
Source§impl TriMatching
impl TriMatching
Sourcepub fn new(left: NodeRef, base: NodeRef, right: NodeRef) -> Self
pub fn new(left: NodeRef, base: NodeRef, right: NodeRef) -> Self
Creates a new TriMatching using the default HeuristicMatching algorithm.
Sourcepub fn with_copy_threshold(
left: NodeRef,
base: NodeRef,
right: NodeRef,
copy_threshold: i32,
) -> Self
pub fn with_copy_threshold( left: NodeRef, base: NodeRef, right: NodeRef, copy_threshold: i32, ) -> Self
Creates a new TriMatching with a custom copy threshold.
The copy threshold determines the minimum size (in info bytes) for a subtree to be considered a copy. Smaller subtrees are treated as separate insertions. Use 0 to disable copy detection.
Sourcepub fn with_matching<L: Matching + Default, R: Matching + Default>(
left: NodeRef,
base: NodeRef,
right: NodeRef,
) -> Self
pub fn with_matching<L: Matching + Default, R: Matching + Default>( left: NodeRef, base: NodeRef, right: NodeRef, ) -> Self
Creates a new TriMatching with custom matching algorithms.
This allows using different matching strategies for left and right branches. For example, DiffMatching could be used for one branch if needed.
Sourcepub fn right_root(&self) -> &NodeRef
pub fn right_root(&self) -> &NodeRef
Returns a reference to the right branch root.
Auto Trait Implementations§
impl Freeze for TriMatching
impl !RefUnwindSafe for TriMatching
impl !Send for TriMatching
impl !Sync for TriMatching
impl Unpin for TriMatching
impl UnsafeUnpin for TriMatching
impl !UnwindSafe for TriMatching
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