pub struct RefTarget { /* private fields */ }
Implementations§
Source§impl RefTarget
impl RefTarget
Sourcepub fn absent_ref() -> &'static Self
pub fn absent_ref() -> &'static Self
Returns non-conflicting target pointing to no commit.
This will typically be used in place of None
returned by map lookup.
Sourcepub fn resolved(maybe_id: Option<CommitId>) -> Self
pub fn resolved(maybe_id: Option<CommitId>) -> Self
Creates non-conflicting target that optionally points to a commit.
Sourcepub fn from_legacy_form(
removed_ids: impl IntoIterator<Item = CommitId>,
added_ids: impl IntoIterator<Item = CommitId>,
) -> Self
pub fn from_legacy_form( removed_ids: impl IntoIterator<Item = CommitId>, added_ids: impl IntoIterator<Item = CommitId>, ) -> Self
Creates target from removed/added ids.
pub fn from_merge(merge: Merge<Option<CommitId>>) -> Self
Sourcepub fn as_resolved(&self) -> Option<&Option<CommitId>>
pub fn as_resolved(&self) -> Option<&Option<CommitId>>
Returns the underlying value if this target is non-conflicting.
Sourcepub fn as_normal(&self) -> Option<&CommitId>
pub fn as_normal(&self) -> Option<&CommitId>
Returns id if this target is non-conflicting and points to a commit.
Sourcepub fn is_present(&self) -> bool
pub fn is_present(&self) -> bool
Returns true if this target points to any commit. Conflicting target is always “present” as it should have at least one commit id.
Sourcepub fn has_conflict(&self) -> bool
pub fn has_conflict(&self) -> bool
Whether this target has conflicts.
pub fn removed_ids(&self) -> impl Iterator<Item = &CommitId>
pub fn added_ids(&self) -> impl Iterator<Item = &CommitId>
pub fn as_merge(&self) -> &Merge<Option<CommitId>>
Trait Implementations§
Source§impl ContentHash for RefTarget
impl ContentHash for RefTarget
impl Eq for RefTarget
impl StructuralPartialEq for RefTarget
Auto Trait Implementations§
impl Freeze for RefTarget
impl RefUnwindSafe for RefTarget
impl Send for RefTarget
impl Sync for RefTarget
impl Unpin for RefTarget
impl UnwindSafe for RefTarget
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> 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§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
Compare self to
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<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