pub enum TextEdit {
Insertion {
at: Offset,
text: String,
},
Deletion {
start: Offset,
end: Offset,
},
}Expand description
One text change: the text a buffer gains at a point, or the stretch it loses.
An edit acts on both halves of the indexing relation — on source text
through Self::apply and on a Span through Span::shifted — and
those two actions are designed to agree.
An insertion carries the text it inserts rather than a pair of boundaries,
because the boundaries are recoverable (at and at + text.len()) while the
text is not, and without the text an edit cannot act on a buffer at all.
Variants§
Implementations§
Trait Implementations§
impl Eq for TextEdit
impl StructuralPartialEq for TextEdit
Auto Trait Implementations§
impl Freeze for TextEdit
impl RefUnwindSafe for TextEdit
impl Send for TextEdit
impl Sync for TextEdit
impl Unpin for TextEdit
impl UnsafeUnpin for TextEdit
impl UnwindSafe for TextEdit
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