pub struct ResolvedChangeTargets {
pub targets: Vec<(CommitId, ResolvedChangeState)>,
}Expand description
Represents the possible target commits of a resolved change ID. If the change is divergent, there may be multiple visible commits. Hidden commits can also be returned to allow showing a change offset number in the evolog.
Fields§
§targets: Vec<(CommitId, ResolvedChangeState)>All indexed commits with this change ID. The sort order of the commits is determined by the index implementation, but it is preferred that more recent commits should be sorted before later commits when possible. All visible commits must be included, but some hidden commits may be omitted if it would be inefficient for the index to support them.
Implementations§
Source§impl ResolvedChangeTargets
impl ResolvedChangeTargets
Sourcepub fn visible_with_offsets(&self) -> impl Iterator<Item = (usize, &CommitId)>
pub fn visible_with_offsets(&self) -> impl Iterator<Item = (usize, &CommitId)>
Returns an iterator over all visible commits for this change ID, as well as their offsets.
Sourcepub fn has_visible(&self, commit: &CommitId) -> bool
pub fn has_visible(&self, commit: &CommitId) -> bool
Returns true if the commit ID is one of the visible targets of this change ID.
Sourcepub fn is_divergent(&self) -> bool
pub fn is_divergent(&self) -> bool
Returns true if there are multiple visible targets for this change ID.
Sourcepub fn at_offset(&self, offset: usize) -> Option<&CommitId>
pub fn at_offset(&self, offset: usize) -> Option<&CommitId>
Returns the commit ID at a given offset. The change offset of a commit
can be found using ResolvedChangeTargets::find_offset.
Sourcepub fn find_offset(&self, commit_id: &CommitId) -> Option<usize>
pub fn find_offset(&self, commit_id: &CommitId) -> Option<usize>
Finds the change offset corresponding to a commit. Newer commits should generally have a lower offset than older commits, but this is not guaranteed. Hidden commits may not have an offset at all.
Sourcepub fn into_visible(self) -> Option<Vec<CommitId>>
pub fn into_visible(self) -> Option<Vec<CommitId>>
Extracts the visible commits for this change ID. Returns None if there
are no visible commits with this change ID.
Trait Implementations§
Source§impl Clone for ResolvedChangeTargets
impl Clone for ResolvedChangeTargets
Source§fn clone(&self) -> ResolvedChangeTargets
fn clone(&self) -> ResolvedChangeTargets
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ResolvedChangeTargets
impl Debug for ResolvedChangeTargets
Source§impl PartialEq for ResolvedChangeTargets
impl PartialEq for ResolvedChangeTargets
impl Eq for ResolvedChangeTargets
impl StructuralPartialEq for ResolvedChangeTargets
Auto Trait Implementations§
impl Freeze for ResolvedChangeTargets
impl RefUnwindSafe for ResolvedChangeTargets
impl Send for ResolvedChangeTargets
impl Sync for ResolvedChangeTargets
impl Unpin for ResolvedChangeTargets
impl UnwindSafe for ResolvedChangeTargets
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
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>
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