pub struct Transaction { /* private fields */ }Expand description
A pending change: a Transform plus selection and history intent.
Implementations§
Source§impl Transaction
impl Transaction
Sourcepub fn transform(&mut self) -> &mut Transform
pub fn transform(&mut self) -> &mut Transform
Mutable access to the underlying transform (apply steps via its
helpers, e.g. tx.transform().replace(..)).
Sourcepub fn set_selection(&mut self, selection: Selection) -> &mut Self
pub fn set_selection(&mut self, selection: Selection) -> &mut Self
Explicitly set the selection for the resulting state.
Sourcepub fn no_history(&mut self) -> &mut Self
pub fn no_history(&mut self) -> &mut Self
Exclude this transaction from undo history.
Sourcepub fn join_history(&mut self) -> &mut Self
pub fn join_history(&mut self) -> &mut Self
Merge this transaction into the previous undo group (e.g. continued typing). Grouping is caller-driven in v0.1.
Sourcepub fn doc_changed(&self) -> bool
pub fn doc_changed(&self) -> bool
Whether the document was changed.
Sourcepub fn set_history_intent(&mut self, intent: HistoryIntent) -> &mut Self
pub fn set_history_intent(&mut self, intent: HistoryIntent) -> &mut Self
Tag this transaction so EditorState::apply walks the undo/redo
stack instead of applying steps. Used by the History extension’s
commands to dispatch through the normal Command/Dispatch pipeline.
Sourcepub fn history_intent(&self) -> Option<HistoryIntent>
pub fn history_intent(&self) -> Option<HistoryIntent>
The history intent on this transaction, if any.
Trait Implementations§
Source§impl Clone for Transaction
impl Clone for Transaction
Source§fn clone(&self) -> Transaction
fn clone(&self) -> Transaction
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 !RefUnwindSafe for Transaction
impl !UnwindSafe for Transaction
impl Freeze for Transaction
impl Send for Transaction
impl Sync for Transaction
impl Unpin for Transaction
impl UnsafeUnpin for Transaction
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