pub struct Recovery<'a> { /* private fields */ }Expand description
Borrowed recovery engine. Cheap to construct; borrows the snapshot store
for the duration of a single try_recover call.
Implementations§
Source§impl<'a> Recovery<'a>
impl<'a> Recovery<'a>
Sourcepub fn new(store: &'a dyn SnapshotStore) -> Self
pub fn new(store: &'a dyn SnapshotStore) -> Self
Create a recovery engine backed by store.
Sourcepub fn try_recover(
&self,
args: RecoveryArgs<'a>,
) -> Result<RecoveryResult, RecoveryFailure>
pub fn try_recover( &self, args: RecoveryArgs<'a>, ) -> Result<RecoveryResult, RecoveryFailure>
Attempt to recover a stale-tag edit.
Decision tree (M1):
- Look up the snapshot for
(path, file_hash). Missing →NoSnapshot. - If that snapshot IS the current head, the live file was modified
externally →
ExternalModification(M1.5 would 3-way-merge). - Otherwise the tag is an older in-session version. Try session-chain replay: if line count matches and every anchor line is byte-identical between snapshot and live, apply the edits directly to live.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Recovery<'a>
impl<'a> !UnwindSafe for Recovery<'a>
impl<'a> Freeze for Recovery<'a>
impl<'a> Send for Recovery<'a>
impl<'a> Sync for Recovery<'a>
impl<'a> Unpin for Recovery<'a>
impl<'a> UnsafeUnpin for Recovery<'a>
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