pub struct Rollback { /* private fields */ }Expand description
An unfinished run, and what taking it back does.
Nothing is written until apply.
A run is unfinished while conflicts wait in .devset/conflicts/. Taking it back returns
every file it wrote, and .devset/’s records, to what they held before it, and discards its
conflicts, as though it had not run.
Implementations§
Source§impl Rollback
impl Rollback
Sourcepub fn of(target: &Target) -> Result<Self>
pub fn of(target: &Target) -> Result<Self>
The unfinished update in target.
§Errors
MergeError::NothingToAbort, no run is unfinished.Error::Parse, what the run saved does not parse.
Sourcepub fn reverts(&self) -> &[Revert]
pub fn reverts(&self) -> &[Revert]
What taking the run back does to target files, in path order.
Sourcepub fn changed(&self) -> &[String]
pub fn changed(&self) -> &[String]
Files changed since the run, which taking it back discards, from the target root.
Sourcepub fn apply(self, target: &Target, force: bool) -> Result<Vec<Revert>>
pub fn apply(self, target: &Target, force: bool) -> Result<Vec<Revert>>
Takes the run back in target, returning what it did to target files.
Target files and sidecars go first, then .devset/’s records with state.toml last, then
.devset/conflicts/; an interruption leaves a rollback that runs again.
§Errors
MergeError::ChangedSince, files changed since the run andforceis off; nothing is written.TargetError::BusyorTargetError::Concurrent, another devset is at work.MergeError::CorruptUndo, a saved copy is missing or damaged; what was restored before it stays restored.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Rollback
impl RefUnwindSafe for Rollback
impl Send for Rollback
impl Sync for Rollback
impl Unpin for Rollback
impl UnsafeUnpin for Rollback
impl UnwindSafe for Rollback
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