Struct Edit
pub struct Edit { /* private fields */ }Implementations§
§impl Edit
impl Edit
pub fn new() -> Edit
pub fn identity(rope: &Rope) -> Edit
pub fn ops(&self) -> &[Op]
pub fn is_empty(&self) -> bool
pub fn retain(&mut self, byte_length: usize)
pub fn retain_rest(&mut self, rope: &Rope) -> Result<(), Error>
pub fn delete(&mut self, text: &str)
pub fn insert(&mut self, text: &str)
pub fn compose(&self, other: &Edit) -> Result<Edit, Error>
pub fn invert(&self) -> Edit
pub fn rebase(&self, onto: &Edit, bias: Bias) -> Result<Edit, Error>
pub fn map_position(&self, byte_index: usize, bias: Bias) -> usize
pub fn map_positions(&self, byte_indexes: &mut [usize], bias: Bias)
pub fn map_positions(&self, byte_indexes: &mut [usize], bias: Bias)
Input must be within the edit’s input length.
pub fn map_positions_sorted(&self, byte_indexes: &mut [usize], bias: Bias)
pub fn map_positions_sorted(&self, byte_indexes: &mut [usize], bias: Bias)
Input must be sorted and within the edit’s input length.
pub fn apply(&self, rope: &mut Rope) -> Result<(), Error>
Trait Implementations§
impl Eq for Edit
impl StructuralPartialEq for Edit
Auto Trait Implementations§
impl Freeze for Edit
impl RefUnwindSafe for Edit
impl Send for Edit
impl Sync for Edit
impl Unpin for Edit
impl UnsafeUnpin for Edit
impl UnwindSafe for Edit
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.