pub struct Change {
pub old: Range<usize>,
pub new: Range<usize>,
}Expand description
The byte-level effect of an Editor edit: old is the range of the
pre-edit source that was replaced, new the range the replacement now
occupies in the post-edit source (they share a start). An insertion has an
empty old; a deletion an empty new. Everything a caret/selection needs
to re-anchor across an edit without re-diffing: shift any offset >= old.end
by new.len() - old.len().
Fields§
§old: Range<usize>§new: Range<usize>Implementations§
Trait Implementations§
impl Eq for Change
impl StructuralPartialEq for Change
Auto Trait Implementations§
impl Freeze for Change
impl RefUnwindSafe for Change
impl Send for Change
impl Sync for Change
impl Unpin for Change
impl UnsafeUnpin for Change
impl UnwindSafe for Change
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