pub struct CommitWithSelection {
pub commit: Commit,
pub selected_tree: MergedTree,
pub parent_tree: MergedTree,
}Fields§
§commit: Commit§selected_tree: MergedTree§parent_tree: MergedTreeImplementations§
Source§impl CommitWithSelection
impl CommitWithSelection
Sourcepub fn is_full_selection(&self) -> bool
pub fn is_full_selection(&self) -> bool
Returns true if the selection contains all changes in the commit.
Sourcepub fn is_empty_selection(&self) -> bool
pub fn is_empty_selection(&self) -> bool
Returns true if the selection matches the parent tree (contains no changes from the commit).
Both is_full_selection() and is_empty_selection()
can be true if the commit is itself empty.
Sourcepub fn diff_with_labels(
&self,
parent_tree_label: &str,
selected_tree_label: &str,
full_selection_label: &str,
) -> BackendResult<Diff<(MergedTree, String)>>
pub fn diff_with_labels( &self, parent_tree_label: &str, selected_tree_label: &str, full_selection_label: &str, ) -> BackendResult<Diff<(MergedTree, String)>>
Returns a diff of labeled trees which represents the selected changes.
This can be used with MergedTree::merge and Merge::from_diffs to
apply the selected changes to a tree.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CommitWithSelection
impl !RefUnwindSafe for CommitWithSelection
impl Send for CommitWithSelection
impl Sync for CommitWithSelection
impl Unpin for CommitWithSelection
impl !UnwindSafe for CommitWithSelection
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more