pub struct TextReplaceCmd {
pub target: WidgetId,
pub position: usize,
pub old_text: String,
pub new_text: String,
pub metadata: CommandMetadata,
/* private fields */
}Expand description
Command to replace text at a position.
Fields§
§target: WidgetIdTarget widget.
position: usizePosition to replace at (byte offset).
old_text: StringOriginal text that was replaced.
new_text: StringNew text that replaced it.
metadata: CommandMetadataCommand metadata.
Implementations§
Trait Implementations§
Source§impl Debug for TextReplaceCmd
impl Debug for TextReplaceCmd
Source§impl UndoableCmd for TextReplaceCmd
impl UndoableCmd for TextReplaceCmd
Source§fn execute(&mut self) -> CommandResult
fn execute(&mut self) -> CommandResult
Execute the command, applying its effect.
Source§fn undo(&mut self) -> CommandResult
fn undo(&mut self) -> CommandResult
Undo the command, reverting its effect.
Source§fn description(&self) -> &str
fn description(&self) -> &str
Human-readable description for UI display.
Source§fn size_bytes(&self) -> usize
fn size_bytes(&self) -> usize
Size of this command in bytes for memory budgeting.
Source§fn metadata(&self) -> &CommandMetadata
fn metadata(&self) -> &CommandMetadata
Get the command metadata.
Source§fn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
Downcast to mutable concrete type for merging.
Source§fn debug_name(&self) -> &'static str
fn debug_name(&self) -> &'static str
Debug description of the command.
Source§fn redo(&mut self) -> CommandResult
fn redo(&mut self) -> CommandResult
Redo the command after it was undone.
Source§fn can_merge(&self, _other: &dyn UndoableCmd, _config: &MergeConfig) -> bool
fn can_merge(&self, _other: &dyn UndoableCmd, _config: &MergeConfig) -> bool
Check if this command can merge with another.
Source§fn accept_merge(&mut self, _other: &dyn UndoableCmd) -> bool
fn accept_merge(&mut self, _other: &dyn UndoableCmd) -> bool
Accept a merge from another command. Read more
Auto Trait Implementations§
impl Freeze for TextReplaceCmd
impl !RefUnwindSafe for TextReplaceCmd
impl Send for TextReplaceCmd
impl Sync for TextReplaceCmd
impl Unpin for TextReplaceCmd
impl UnsafeUnpin for TextReplaceCmd
impl !UnwindSafe for TextReplaceCmd
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