pub struct TextChange {
pub value: String,
pub old_index: Option<i32>,
pub new_index: Option<i32>,
pub tag: TextChangeType,
}Expand description
A single word-level change within a text field
Represents one unit of change in a diff, typically a word or whitespace token. Each change has a type (Insert, Delete, or Equal) and position indices in the old and new text.
Fields§
§value: StringThe text value of this change (a word or whitespace)
old_index: Option<i32>Position in the original text (None for insertions)
new_index: Option<i32>Position in the new text (None for deletions)
tag: TextChangeTypeThe type of change
Trait Implementations§
Source§impl Clone for TextChange
impl Clone for TextChange
Source§fn clone(&self) -> TextChange
fn clone(&self) -> TextChange
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 TextChange
impl Debug for TextChange
Source§impl<'de> Deserialize<'de> for TextChange
impl<'de> Deserialize<'de> for TextChange
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Hash for TextChange
impl Hash for TextChange
Source§impl PartialEq for TextChange
impl PartialEq for TextChange
Source§fn eq(&self, other: &TextChange) -> bool
fn eq(&self, other: &TextChange) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for TextChange
impl Serialize for TextChange
impl Eq for TextChange
impl StructuralPartialEq for TextChange
Auto Trait Implementations§
impl Freeze for TextChange
impl RefUnwindSafe for TextChange
impl Send for TextChange
impl Sync for TextChange
impl Unpin for TextChange
impl UnsafeUnpin for TextChange
impl UnwindSafe for TextChange
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<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