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§impl Debug for TextDeltaEdit
impl Debug for TextDeltaEdit
impl Eq for TextDeltaEdit
Source§impl PartialEq for TextDeltaEdit
impl PartialEq for TextDeltaEdit
impl StructuralPartialEq for TextDeltaEdit
Auto Trait Implementations§
impl Forget for TextDeltaEdit
impl Freeze for TextDeltaEdit
impl Move for TextDeltaEdit
impl RefUnwindSafe for TextDeltaEdit
impl Send for TextDeltaEditwhere
RawVecInner: Send,
impl Sync for TextDeltaEditwhere
RawVecInner: Sync,
impl Unpin for TextDeltaEdit
impl UnsafeUnpin for TextDeltaEdit
impl UnwindSafe for TextDeltaEditwhere
RawVecInner: UnwindSafe,
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