pub struct UndoLog { /* private fields */ }Expand description
Manages the undo log.
Implementations§
Source§impl UndoLog
impl UndoLog
pub fn new(max_entries: usize) -> Self
Sourcepub fn from_jsonl(content: &str, max_entries: usize) -> Self
pub fn from_jsonl(content: &str, max_entries: usize) -> Self
Load undo log from JSONL content.
Sourcepub fn push(&mut self, record: UndoRecord)
pub fn push(&mut self, record: UndoRecord)
Append a new undo record.
Sourcepub fn pop(&mut self, count: usize) -> Vec<UndoRecord>
pub fn pop(&mut self, count: usize) -> Vec<UndoRecord>
Remove the last N records and return them (for undo).
pub fn is_empty(&self) -> bool
Sourcepub fn recent(&self, count: usize) -> &[UndoRecord]
pub fn recent(&self, count: usize) -> &[UndoRecord]
Get recent entries for display.
Auto Trait Implementations§
impl Freeze for UndoLog
impl RefUnwindSafe for UndoLog
impl Send for UndoLog
impl Sync for UndoLog
impl Unpin for UndoLog
impl UnsafeUnpin for UndoLog
impl UnwindSafe for UndoLog
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