pub struct MergeOptions {
pub conflict_marker_length: usize,
pub style: ConflictStyle,
pub algorithm: Algorithm,
}
Expand description
A collection of options for modifying the way a merge is performed
Fields§
§conflict_marker_length: usize
The length of the conflict markers used when displaying a merge conflict
style: ConflictStyle
The conflict style used when displaying a merge conflict
algorithm: Algorithm
Implementations§
Source§impl MergeOptions
impl MergeOptions
Sourcepub fn new() -> Self
pub fn new() -> Self
Constructs a new MergeOptions
with default settings
§Defaults
- conflict_marker_length = 7
- style = ConflictStyle::Diff3
Sourcepub fn merge<'a>(
&self,
ancestor: &'a str,
ours: &'a str,
theirs: &'a str,
) -> Result<String, String>
pub fn merge<'a>( &self, ancestor: &'a str, ours: &'a str, theirs: &'a str, ) -> Result<String, String>
Merge two files, given a common ancestor, based on the configured options
The algorithm set in Self::algorithm
is used for computing the diff between ancestor
and ours
, and between ancestor
and theirs
Trait Implementations§
Source§impl Debug for MergeOptions
impl Debug for MergeOptions
Auto Trait Implementations§
impl Freeze for MergeOptions
impl RefUnwindSafe for MergeOptions
impl Send for MergeOptions
impl Sync for MergeOptions
impl Unpin for MergeOptions
impl UnwindSafe for MergeOptions
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