pub struct SourceEdit {
pub start: usize,
pub end: usize,
pub new_text: String,
}Expand description
Represents a single source edit (insert or delete).
Fields§
§start: usize§end: usize§new_text: StringImplementations§
Source§impl SourceEdit
impl SourceEdit
pub fn insert(pos: usize, text: impl Into<String>) -> Self
pub fn delete(start: usize, end: usize) -> Self
pub fn replace(start: usize, end: usize, text: impl Into<String>) -> Self
pub fn is_insert(&self) -> bool
pub fn is_delete(&self) -> bool
pub fn is_replace(&self) -> bool
pub fn delta(&self) -> i64
Trait Implementations§
Source§impl Clone for SourceEdit
impl Clone for SourceEdit
Source§fn clone(&self) -> SourceEdit
fn clone(&self) -> SourceEdit
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 moreAuto Trait Implementations§
impl Freeze for SourceEdit
impl RefUnwindSafe for SourceEdit
impl Send for SourceEdit
impl Sync for SourceEdit
impl Unpin for SourceEdit
impl UnsafeUnpin for SourceEdit
impl UnwindSafe for SourceEdit
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