pub struct StackItem<T> {
pub meta: T,
/* private fields */
}Expand description
A unit of work for the UndoManager. It contains a compressed information about all updates and deletions tracked by a corresponding undo manager. Whenever an [UndoManger::undo] or UndoManager::redo methods are called a last StackItem is being used to modify a state of the document.
Stack items are stored internally by undo manager and created automatically whenever a new update from tracked shared type and transaction of tracked origin has been committed within a threshold specified by Options::capture_timeout_millis time window since the previous stack item creation. They can also be created explicitly by calling UndoManager::reset, which marks the end of the last stack item batch.
Fields§
§meta: TA custom user metadata that can be attached to a particular StackItem. It can be used to carry over the additional information (such as ie. user cursor position) between undo/redo operations.
Implementations§
Trait Implementations§
impl<T> Eq for StackItem<T>where
T: Eq,
impl<T> StructuralPartialEq for StackItem<T>
Auto Trait Implementations§
impl<T> Freeze for StackItem<T>where
T: Freeze,
impl<T> RefUnwindSafe for StackItem<T>where
T: RefUnwindSafe,
impl<T> Send for StackItem<T>where
T: Send,
impl<T> Sync for StackItem<T>where
T: Sync,
impl<T> Unpin for StackItem<T>where
T: Unpin,
impl<T> UnwindSafe for StackItem<T>where
T: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.