pub struct EditSession { /* private fields */ }Expand description
An edit session tracks backups for atomic multi-file operations.
Implementations§
Source§impl EditSession
impl EditSession
pub fn new() -> Self
Sourcepub fn backup(&mut self, path: &Path) -> Result<()>
pub fn backup(&mut self, path: &Path) -> Result<()>
Back up a file before editing. Idempotent per path.
Sourcepub fn revert_all(&self) -> Result<()>
pub fn revert_all(&self) -> Result<()>
Revert all edits by restoring backups.
Sourcepub fn commit_all(&self) -> Result<()>
pub fn commit_all(&self) -> Result<()>
Commit all edits by deleting backups.
pub fn has_changes(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EditSession
impl RefUnwindSafe for EditSession
impl Send for EditSession
impl Sync for EditSession
impl Unpin for EditSession
impl UnsafeUnpin for EditSession
impl UnwindSafe for EditSession
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