pub struct Rollback { /* private fields */ }Expand description
An unfinished update, and what taking it back does.
Nothing is written until apply.
An update 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 update is unfinished.Error::Parse, what the update saved does not parse.
Sourcepub fn reverts(&self) -> &[Revert]
pub fn reverts(&self) -> &[Revert]
What taking the update back does to target files, in path order.
Sourcepub fn changed(&self) -> &[String]
pub fn changed(&self) -> &[String]
Files changed since the update, 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 update 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 update 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