pub enum TextEditOperation {
Insert {
position: usize,
text: String,
},
Delete {
position: usize,
deleted_text: String,
},
Replace {
position: usize,
old_text: String,
new_text: String,
},
SetValue {
old_value: String,
new_value: String,
},
}Expand description
Text edit operation types.
These represent the atomic operations that can be performed on text.
Variants§
Insert
Insert text at a position.
Delete
Delete text at a position.
Fields
Replace
Replace text at a position.
Fields
SetValue
Set the entire value.
Implementations§
Source§impl TextEditOperation
impl TextEditOperation
Sourcepub fn description(&self) -> &'static str
pub fn description(&self) -> &'static str
Get a description of this operation.
Sourcepub fn size_bytes(&self) -> usize
pub fn size_bytes(&self) -> usize
Calculate the size in bytes of this operation.
Trait Implementations§
Source§impl Clone for TextEditOperation
impl Clone for TextEditOperation
Source§fn clone(&self) -> TextEditOperation
fn clone(&self) -> TextEditOperation
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 TextEditOperation
impl RefUnwindSafe for TextEditOperation
impl Send for TextEditOperation
impl Sync for TextEditOperation
impl Unpin for TextEditOperation
impl UnsafeUnpin for TextEditOperation
impl UnwindSafe for TextEditOperation
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