pub struct IncrementalEdit {
pub start_byte: usize,
pub old_end_byte: usize,
pub new_text: String,
pub start_position: Position,
pub old_end_position: Position,
}Expand description
Enhanced edit with text content for incremental parsing
Fields§
§start_byte: usizeStart byte offset of the edit
old_end_byte: usizeEnd byte offset of the text being replaced (in old source)
new_text: StringThe new text being inserted
start_position: PositionStart position (line/column)
old_end_position: PositionOld end position before edit
Implementations§
Source§impl IncrementalEdit
impl IncrementalEdit
Sourcepub fn new(
start_byte: usize,
old_end_byte: usize,
new_text: String,
) -> IncrementalEdit
pub fn new( start_byte: usize, old_end_byte: usize, new_text: String, ) -> IncrementalEdit
Create a new incremental edit
Sourcepub fn with_positions(
start_byte: usize,
old_end_byte: usize,
new_text: String,
start_position: Position,
old_end_position: Position,
) -> IncrementalEdit
pub fn with_positions( start_byte: usize, old_end_byte: usize, new_text: String, start_position: Position, old_end_position: Position, ) -> IncrementalEdit
Create with position information
Sourcepub fn new_end_byte(&self) -> usize
pub fn new_end_byte(&self) -> usize
Get the new end byte after applying this edit
Sourcepub fn byte_shift(&self) -> isize
pub fn byte_shift(&self) -> isize
Calculate the byte shift caused by this edit
Trait Implementations§
Source§impl Clone for IncrementalEdit
impl Clone for IncrementalEdit
Source§fn clone(&self) -> IncrementalEdit
fn clone(&self) -> IncrementalEdit
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 IncrementalEdit
impl Debug for IncrementalEdit
Source§impl PartialEq for IncrementalEdit
impl PartialEq for IncrementalEdit
impl StructuralPartialEq for IncrementalEdit
Auto Trait Implementations§
impl Freeze for IncrementalEdit
impl RefUnwindSafe for IncrementalEdit
impl Send for IncrementalEdit
impl Sync for IncrementalEdit
impl Unpin for IncrementalEdit
impl UnsafeUnpin for IncrementalEdit
impl UnwindSafe for IncrementalEdit
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