pub struct IncrementalEditSet {
pub edits: Vec<IncrementalEdit>,
}Expand description
Collection of incremental edits
Fields§
§edits: Vec<IncrementalEdit>Implementations§
Source§impl IncrementalEditSet
impl IncrementalEditSet
Sourcepub fn new() -> IncrementalEditSet
pub fn new() -> IncrementalEditSet
Create a new empty edit set
Sourcepub fn add(&mut self, edit: IncrementalEdit)
pub fn add(&mut self, edit: IncrementalEdit)
Add an edit to the set
Sourcepub fn sort_reverse(&mut self)
pub fn sort_reverse(&mut self)
Sort edits in reverse order (for applying from end to start)
Sourcepub fn total_byte_shift(&self) -> isize
pub fn total_byte_shift(&self) -> isize
Get the total byte shift for all edits
Sourcepub fn apply_to_string(&self, source: &str) -> String
pub fn apply_to_string(&self, source: &str) -> String
Apply edits to a string
Trait Implementations§
Source§impl Clone for IncrementalEditSet
impl Clone for IncrementalEditSet
Source§fn clone(&self) -> IncrementalEditSet
fn clone(&self) -> IncrementalEditSet
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 IncrementalEditSet
impl Debug for IncrementalEditSet
Source§impl Default for IncrementalEditSet
impl Default for IncrementalEditSet
Source§fn default() -> IncrementalEditSet
fn default() -> IncrementalEditSet
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for IncrementalEditSet
impl RefUnwindSafe for IncrementalEditSet
impl Send for IncrementalEditSet
impl Sync for IncrementalEditSet
impl Unpin for IncrementalEditSet
impl UnsafeUnpin for IncrementalEditSet
impl UnwindSafe for IncrementalEditSet
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