gix_merge::tree

Struct Outcome

Source
pub struct Outcome<'a> {
    pub tree: Editor<'a>,
    pub conflicts: Vec<Conflict>,
    pub failed_on_first_unresolved_conflict: bool,
}
Expand description

The outcome produced by tree().

Fields§

§tree: Editor<'a>

The ready-made (but unwritten) base tree, including all non-conflicting changes, and the changes that had conflicts which could be resolved automatically.

This means, if all of their changes were conflicting, this will be equivalent to the base tree.

§conflicts: Vec<Conflict>

The set of conflicts we encountered. Can be empty to indicate there was no conflict. Note that conflicts might have been auto-resolved, but they are listed here for completeness. Use has_unresolved_conflicts() to see if any action is needed before using tree.

§failed_on_first_unresolved_conflict: bool

true if conflicts contains only a single unresolved conflict in the last slot, but possibly more resolved ones. This also makes this outcome a very partial merge that cannot be completed. Only set if fail_on_conflict is true.

Implementations§

Source§

impl Outcome<'_>

Source

pub fn has_unresolved_conflicts(&self, how: TreatAsUnresolved) -> bool

Return true if there is any conflict that would still need to be resolved as they would yield undesirable trees. This is based on how to determine what should be considered unresolved.

Source

pub fn index_changed_after_applying_conflicts( &self, index: &mut State, how: TreatAsUnresolved, ) -> bool

Returns true if index changed as we applied conflicting stages to it, using how to determine if a conflict should be considered unresolved. It’s important that index is at the state of Self::tree.

Note that in practice, whenever there is a single conflict, this function will return true. Also, the unconflicted stage of such entries will be removed merely by setting a flag, so the in-memory entry is still present.

Trait Implementations§

Source§

impl<'a> Clone for Outcome<'a>

Source§

fn clone(&self) -> Outcome<'a>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl<'a> !Freeze for Outcome<'a>

§

impl<'a> !RefUnwindSafe for Outcome<'a>

§

impl<'a> !Send for Outcome<'a>

§

impl<'a> !Sync for Outcome<'a>

§

impl<'a> Unpin for Outcome<'a>

§

impl<'a> !UnwindSafe for Outcome<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.