pub struct VersionLookup { /* private fields */ }Expand description
In-memory index mapping inodes and content hashes to version snapshots.
Implementations§
Source§impl VersionLookup
impl VersionLookup
Sourcepub fn index_directory(&self)
pub fn index_directory(&self)
Scans the versions directory and builds the inode and hash indexes.
Sourcepub fn register(&self, v: FileVersion)
pub fn register(&self, v: FileVersion)
Registers a new version entry, inserting it in sorted order.
Sourcepub fn wait_for_scan(&self)
pub fn wait_for_scan(&self)
Blocks the calling thread until the background index scan completes.
Sourcepub fn find_by_hash(
&self,
hash: u64,
size: u64,
verification_sample: &[u8],
) -> Option<PathBuf>
pub fn find_by_hash( &self, hash: u64, size: u64, verification_sample: &[u8], ) -> Option<PathBuf>
Finds a version file by content hash, size, and optional byte-level verification.
Sourcepub fn find_by_inode(
&self,
inode: u64,
size: u64,
mtime: i64,
) -> Option<PathBuf>
pub fn find_by_inode( &self, inode: u64, size: u64, mtime: i64, ) -> Option<PathBuf>
Finds a version file by inode number, matching on size and mtime.
Sourcepub fn list(&self, inode: u64) -> Vec<FileVersion>
pub fn list(&self, inode: u64) -> Vec<FileVersion>
Returns all versions for the given inode, sorted by epoch and timestamp.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for VersionLookup
impl !RefUnwindSafe for VersionLookup
impl Send for VersionLookup
impl Sync for VersionLookup
impl Unpin for VersionLookup
impl UnsafeUnpin for VersionLookup
impl UnwindSafe for VersionLookup
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more