Skip to main content

Recovery

Struct Recovery 

Source
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>

Source

pub fn new(store: &'a dyn SnapshotStore) -> Self

Create a recovery engine backed by store.

Source

pub fn try_recover( &self, args: RecoveryArgs<'a>, ) -> Result<RecoveryResult, RecoveryFailure>

Attempt to recover a stale-tag edit.

Decision tree (M1):

  1. Look up the snapshot for (path, file_hash). Missing → NoSnapshot.
  2. If that snapshot IS the current head, the live file was modified externally → ExternalModification (M1.5 would 3-way-merge).
  3. 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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.