Struct similar::InlineChange [−][src]
Represents the expanded textual change with inline highlights.
This is like Change
but with inline highlight info.
Implementations
impl<'s, T: DiffableStr + ?Sized> InlineChange<'s, T>
[src]
pub fn tag(&self) -> ChangeTag
[src]
Returns the change tag.
pub fn old_index(&self) -> Option<usize>
[src]
Returns the old index if available.
pub fn new_index(&self) -> Option<usize>
[src]
Returns the new index if available.
pub fn values(&self) -> &[(bool, &'s T)]
[src]
Returns the changed values.
Each item is a tuple in the form (emphasized, value)
where emphasized
is true if it should be highlighted as an inline diff.
Depending on the type of the underlying DiffableStr
this value is
more or less useful. If you always want to have a utf-8 string it’s
better to use the InlineChange::iter_strings_lossy
method.
pub fn iter_strings_lossy(&self) -> impl Iterator<Item = (bool, Cow<'_, str>)>
[src]
Iterates over all (potentially lossy) utf-8 decoded values.
Each item is a tuple in the form (emphasized, value)
where emphasized
is true if it should be highlighted as an inline diff.
pub fn missing_newline(&self) -> bool
[src]
Returns true
if this change does not end in a newline and must be
followed up by one if line based diffs are used.
Trait Implementations
impl<'s, T: Clone + DiffableStr + ?Sized> Clone for InlineChange<'s, T>
[src]
fn clone(&self) -> InlineChange<'s, T>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'s, T: Debug + DiffableStr + ?Sized> Debug for InlineChange<'s, T>
[src]
impl<'s, T: DiffableStr + ?Sized> Display for InlineChange<'s, T>
[src]
impl<'s, T: Eq + DiffableStr + ?Sized> Eq for InlineChange<'s, T>
[src]
impl<'s, T: DiffableStr + ?Sized> From<Change<'s, T>> for InlineChange<'s, T>
[src]
fn from(change: Change<'s, T>) -> InlineChange<'s, T>
[src]
impl<'s, T: Hash + DiffableStr + ?Sized> Hash for InlineChange<'s, T>
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<'s, T: Ord + DiffableStr + ?Sized> Ord for InlineChange<'s, T>
[src]
fn cmp(&self, other: &InlineChange<'s, T>) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl<'s, T: PartialEq + DiffableStr + ?Sized> PartialEq<InlineChange<'s, T>> for InlineChange<'s, T>
[src]
fn eq(&self, other: &InlineChange<'s, T>) -> bool
[src]
fn ne(&self, other: &InlineChange<'s, T>) -> bool
[src]
impl<'s, T: PartialOrd + DiffableStr + ?Sized> PartialOrd<InlineChange<'s, T>> for InlineChange<'s, T>
[src]
fn partial_cmp(&self, other: &InlineChange<'s, T>) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'s, T: DiffableStr + ?Sized> StructuralEq for InlineChange<'s, T>
[src]
impl<'s, T: DiffableStr + ?Sized> StructuralPartialEq for InlineChange<'s, T>
[src]
Auto Trait Implementations
impl<'s, T: ?Sized> RefUnwindSafe for InlineChange<'s, T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<'s, T: ?Sized> Send for InlineChange<'s, T> where
T: Sync,
T: Sync,
impl<'s, T: ?Sized> Sync for InlineChange<'s, T> where
T: Sync,
T: Sync,
impl<'s, T: ?Sized> Unpin for InlineChange<'s, T>
impl<'s, T: ?Sized> UnwindSafe for InlineChange<'s, T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,