pub struct FileTrackerGuard { /* private fields */ }
Expand description
A guard wrapper around FileTracker that simplifies working with tracked files
Implementations§
Source§impl FileTrackerGuard
impl FileTrackerGuard
Sourcepub fn new_with_restore(restore_enabled: bool) -> Self
pub fn new_with_restore(restore_enabled: bool) -> Self
Creates a new FileTrackerGuard with restore on drop configurable
Sourcepub fn track_file(&mut self, path: &Path) -> Result<()>
pub fn track_file(&mut self, path: &Path) -> Result<()>
Starts tracking a file
Sourcepub fn track_rename(&mut self, source: &Path, target: &Path) -> Result<()>
pub fn track_rename(&mut self, source: &Path, target: &Path) -> Result<()>
Tracks a file rename operation
Sourcepub fn force_rollback(&mut self)
pub fn force_rollback(&mut self)
Force rollback of tracked changes
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FileTrackerGuard
impl RefUnwindSafe for FileTrackerGuard
impl Send for FileTrackerGuard
impl Sync for FileTrackerGuard
impl Unpin for FileTrackerGuard
impl UnwindSafe for FileTrackerGuard
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
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>
Converts
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>
Converts
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 more