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 · 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
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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