#[repr(C)]pub struct TextChangeset {
pub id: ChangesetId,
pub target: DomNodeId,
pub operation: TextOperation,
pub timestamp: Instant,
}Expand description
A text editing changeset that can be inspected before application
Fields§
§id: ChangesetIdUnique ID for undo/redo tracking
target: DomNodeIdTarget DOM node
operation: TextOperationThe operation to perform
timestamp: InstantWhen this changeset was created
Implementations§
Source§impl TextChangeset
impl TextChangeset
Sourcepub fn new(
target: DomNodeId,
operation: TextOperation,
timestamp: Instant,
) -> Self
pub fn new( target: DomNodeId, operation: TextOperation, timestamp: Instant, ) -> Self
Create a new changeset with unique ID
Sourcepub fn mutates_text(&self) -> bool
pub fn mutates_text(&self) -> bool
Check if this changeset actually mutates text (vs just selection/cursor)
Sourcepub fn changes_selection(&self) -> bool
pub fn changes_selection(&self) -> bool
Check if this changeset changes selection (including cursor moves)
Sourcepub fn uses_clipboard(&self) -> bool
pub fn uses_clipboard(&self) -> bool
Check if this changeset involves clipboard
Sourcepub fn resulting_cursor_position(&self) -> Option<CursorPosition>
pub fn resulting_cursor_position(&self) -> Option<CursorPosition>
Get the target cursor position after this changeset is applied
Sourcepub fn resulting_selection_range(&self) -> Option<SelectionRange>
pub fn resulting_selection_range(&self) -> Option<SelectionRange>
Get the target selection range after this changeset is applied
Trait Implementations§
Source§impl Clone for TextChangeset
impl Clone for TextChangeset
Source§fn clone(&self) -> TextChangeset
fn clone(&self) -> TextChangeset
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 TextChangeset
impl RefUnwindSafe for TextChangeset
impl Send for TextChangeset
impl Sync for TextChangeset
impl Unpin for TextChangeset
impl UnwindSafe for TextChangeset
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,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more