pub struct UndoRedoStack { /* private fields */ }Expand description
An undo/redo stack for source text.
Implementations§
Source§impl UndoRedoStack
impl UndoRedoStack
pub fn new(initial: impl Into<String>) -> Self
pub fn push(&mut self, new_source: impl Into<String>)
pub fn apply(&mut self, change: &TextChange)
pub fn undo(&mut self) -> Option<&str>
pub fn redo(&mut self) -> Option<&str>
pub fn current(&self) -> &str
pub fn can_undo(&self) -> bool
pub fn can_redo(&self) -> bool
pub fn undo_depth(&self) -> usize
pub fn redo_depth(&self) -> usize
Auto Trait Implementations§
impl Freeze for UndoRedoStack
impl RefUnwindSafe for UndoRedoStack
impl Send for UndoRedoStack
impl Sync for UndoRedoStack
impl Unpin for UndoRedoStack
impl UnsafeUnpin for UndoRedoStack
impl UnwindSafe for UndoRedoStack
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