pub struct UndoLog { /* private fields */ }Expand description
Undo log with configurable maximum depth.
Implementations§
Source§impl UndoLog
impl UndoLog
Sourcepub fn new(max_entries: usize) -> Self
pub fn new(max_entries: usize) -> Self
Create a new undo log with the specified maximum entries.
Sourcepub fn record(
&mut self,
operation: UndoableOperation,
description: impl Into<String>,
) -> u64
pub fn record( &mut self, operation: UndoableOperation, description: impl Into<String>, ) -> u64
Record an operation in the undo log.
Returns the ID assigned to this entry.
Sourcepub fn record_copy(&mut self, created: Vec<PathBuf>) -> u64
pub fn record_copy(&mut self, created: Vec<PathBuf>) -> u64
Record a copy operation.
Sourcepub fn record_delete(&mut self, paths: Vec<PathBuf>) -> u64
pub fn record_delete(&mut self, paths: Vec<PathBuf>) -> u64
Record a delete operation.
Sourcepub fn record_rename(&mut self, source: PathBuf, new_name: String) -> u64
pub fn record_rename(&mut self, source: PathBuf, new_name: String) -> u64
Record a rename operation.
source is the full original path before the rename.
new_name is the new name component (used for the description).
Sourcepub fn record_create_file(&mut self, path: PathBuf) -> u64
pub fn record_create_file(&mut self, path: PathBuf) -> u64
Record a file creation.
Sourcepub fn record_create_directory(&mut self, path: PathBuf) -> u64
pub fn record_create_directory(&mut self, path: PathBuf) -> u64
Record a directory creation.
Trait Implementations§
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