pub struct TextDeltaEdit {
pub start: usize,
pub deleted_text: String,
pub inserted_text: String,
}Expand description
A single text edit expressed in character offsets.
Semantics:
startis a character offset in the document at the time this edit is applied.- The deleted range is defined by the length (in
chars) ofdeleted_text. - Edits inside a
TextDeltamust be applied in order to transform the “before” document into the “after” document.
Fields§
§start: usizeStart character offset of the edit.
deleted_text: StringExact deleted text (may be empty).
inserted_text: StringExact inserted text (may be empty).
Implementations§
Source§impl TextDeltaEdit
impl TextDeltaEdit
Sourcepub fn deleted_len(&self) -> usize
pub fn deleted_len(&self) -> usize
Length of deleted_text in characters.
Sourcepub fn inserted_len(&self) -> usize
pub fn inserted_len(&self) -> usize
Length of inserted_text in characters.
Trait Implementations§
Source§impl Clone for TextDeltaEdit
impl Clone for TextDeltaEdit
Source§fn clone(&self) -> TextDeltaEdit
fn clone(&self) -> TextDeltaEdit
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 TextDeltaEdit
impl Debug for TextDeltaEdit
Source§impl PartialEq for TextDeltaEdit
impl PartialEq for TextDeltaEdit
impl Eq for TextDeltaEdit
impl StructuralPartialEq for TextDeltaEdit
Auto Trait Implementations§
impl Freeze for TextDeltaEdit
impl RefUnwindSafe for TextDeltaEdit
impl Send for TextDeltaEdit
impl Sync for TextDeltaEdit
impl Unpin for TextDeltaEdit
impl UnsafeUnpin for TextDeltaEdit
impl UnwindSafe for TextDeltaEdit
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