pub struct CommandResult {
pub success: bool,
pub message: Option<String>,
pub modified_range: Option<Range>,
pub new_cursor: Option<Position>,
pub content_changed: bool,
pub script_delta: Option<ScriptDeltaOwned>,
}Expand description
Result of executing a command
Contains the modified document and optional metadata about the operation. This will be used by the history system to track changes.
Fields§
§success: boolWhether the command was successfully executed
message: Option<String>Optional message about the operation
modified_range: Option<Range>The range of text that was modified (for cursor updates)
new_cursor: Option<Position>New cursor position after the command
content_changed: boolWhether the document content was changed
script_delta: Option<ScriptDeltaOwned>Available on crate feature
stream only.Script delta for incremental parsing (when available)
Implementations§
Source§impl CommandResult
impl CommandResult
Sourcepub fn success_with_change(range: Range, cursor: Position) -> Self
pub fn success_with_change(range: Range, cursor: Position) -> Self
Create a successful result with content change
Sourcepub fn with_delta(self, delta: ScriptDeltaOwned) -> Self
Available on crate feature stream only.
pub fn with_delta(self, delta: ScriptDeltaOwned) -> Self
stream only.Add a script delta to the result
Sourcepub fn with_message(self, message: String) -> Self
pub fn with_message(self, message: String) -> Self
Add a message to the result
Trait Implementations§
Source§impl Clone for CommandResult
impl Clone for CommandResult
Source§fn clone(&self) -> CommandResult
fn clone(&self) -> CommandResult
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 CommandResult
impl RefUnwindSafe for CommandResult
impl Send for CommandResult
impl Sync for CommandResult
impl Unpin for CommandResult
impl UnwindSafe for CommandResult
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