pub struct ContentEdit {
pub start_byte: usize,
pub old_end_byte: usize,
pub new_end_byte: usize,
pub start_position: (u32, u32),
pub old_end_position: (u32, u32),
pub new_end_position: (u32, u32),
}Expand description
Engine-native representation of a single buffer mutation in the
shape tree-sitter’s InputEdit consumes. Emitted by
crate::Editor::mutate_edit and drained by hosts via
crate::Editor::take_content_edits so the syntax layer can fan
edits into a retained tree without the engine taking a tree-sitter
dependency.
Positions are (row, col_byte) — byte offsets within the row, not
char counts. Multi-row inserts/deletes set new_end_position.0 /
old_end_position.0 to the relevant row delta. Conversion to
tree_sitter::InputEdit is mechanical (see apps/hjkl/src/syntax.rs).
Fields§
§start_byte: usize§old_end_byte: usize§new_end_byte: usize§start_position: (u32, u32)§old_end_position: (u32, u32)§new_end_position: (u32, u32)Trait Implementations§
Source§impl Clone for ContentEdit
impl Clone for ContentEdit
Source§fn clone(&self) -> ContentEdit
fn clone(&self) -> ContentEdit
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 ContentEdit
impl Debug for ContentEdit
Source§impl PartialEq for ContentEdit
impl PartialEq for ContentEdit
Source§fn eq(&self, other: &ContentEdit) -> bool
fn eq(&self, other: &ContentEdit) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for ContentEdit
impl StructuralPartialEq for ContentEdit
Auto Trait Implementations§
impl Freeze for ContentEdit
impl RefUnwindSafe for ContentEdit
impl Send for ContentEdit
impl Sync for ContentEdit
impl Unpin for ContentEdit
impl UnsafeUnpin for ContentEdit
impl UnwindSafe for ContentEdit
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