pub struct ConflictLabels { /* private fields */ }Expand description
Optionally contains a set of labels for the terms of a conflict. Resolved merges cannot be labeled.
Implementations§
Source§impl ConflictLabels
impl ConflictLabels
Sourcepub fn from_merge(labels: Merge<String>) -> Self
pub fn from_merge(labels: Merge<String>) -> Self
Create a ConflictLabels from a Merge<String>. If the merge is
resolved, the labels will be discarded since resolved merges cannot have
labels.
Sourcepub fn from_vec(labels: Vec<String>) -> Self
pub fn from_vec(labels: Vec<String>) -> Self
Create a ConflictLabels from a Vec<String>, with an empty vec
representing no labels.
Sourcepub fn has_labels(&self) -> bool
pub fn has_labels(&self) -> bool
Returns true if there are labels present.
Sourcepub fn num_sides(&self) -> Option<usize>
pub fn num_sides(&self) -> Option<usize>
Returns the number of sides of the underlying merge if any terms have
labels, or None if there are no labels.
Sourcepub fn into_merge(self) -> Merge<String>
pub fn into_merge(self) -> Merge<String>
Extracts the underlying Merge<String>.
Sourcepub fn as_slice(&self) -> &[String]
pub fn as_slice(&self) -> &[String]
Returns the conflict labels as a slice. If there are no labels, returns an empty slice.
Sourcepub fn get_remove(&self, remove_index: usize) -> Option<&str>
pub fn get_remove(&self, remove_index: usize) -> Option<&str>
Get the label for a base at an index.
Trait Implementations§
Source§impl Clone for ConflictLabels
impl Clone for ConflictLabels
Source§fn clone(&self) -> ConflictLabels
fn clone(&self) -> ConflictLabels
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConflictLabels
impl Debug for ConflictLabels
Source§impl PartialEq for ConflictLabels
impl PartialEq for ConflictLabels
impl Eq for ConflictLabels
impl StructuralPartialEq for ConflictLabels
Auto Trait Implementations§
impl Freeze for ConflictLabels
impl RefUnwindSafe for ConflictLabels
impl Send for ConflictLabels
impl Sync for ConflictLabels
impl Unpin for ConflictLabels
impl UnsafeUnpin for ConflictLabels
impl UnwindSafe for ConflictLabels
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§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<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