Skip to main content

RewindEngine

Struct RewindEngine 

Source
pub struct RewindEngine { /* private fields */ }
Expand description

The Rewind engine for full path reconstruction.

Implementations§

Source§

impl RewindEngine

Source

pub fn new() -> Self

Create a new empty RewindEngine.

Source

pub fn from_mft<I>(mft_entries: I) -> Self
where I: IntoIterator<Item = (u64, u16, String, u64, u16)>,

Create a RewindEngine seeded with MFT entries.

The mft_entries iterator yields (entry_number, sequence, filename, parent_entry, parent_sequence).

Source

pub fn lookup_len(&self) -> usize

Number of entries in the lookup table.

Source

pub fn seed_from_carved(&mut self, entries: &[CarvedMftEntry])

Seed the engine with carved MFT entries from unallocated space.

Uses or_insert so carved entries never overwrite allocated MFT data that was seeded via from_mft. Historical entries (different sequence numbers from the same MFT entry) are added as new keys.

Source

pub fn insert(&mut self, key: EntryKey, info: EntryInfo)

Insert or update an entry in the lookup table.

Source

pub fn resolve_path(&self, key: &EntryKey) -> String

Resolve the full path for a given entry key.

Recursively follows parent references until reaching the root. Returns “.” as the root prefix (representing the volume root).

Source

pub fn rewind(&mut self, records: &[UsnRecord]) -> Vec<ResolvedRecord>

Process USN records using the Rewind algorithm.

Records MUST be sorted by USN/timestamp in ascending order (oldest first). This function processes them in reverse to build the lookup table, then resolves paths for each record in forward order.

Returns resolved records with full paths.

Trait Implementations§

Source§

impl Default for RewindEngine

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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.