Skip to main content

Module merkle_index

Module merkle_index 

Source
Expand description

Per-target consolidated Merkle signature index for large files (>256MB). Stores large Merkle signatures that exceed the 64KB xattr limit in a consolidated per-target index file at <target>/.foxing_meta/merkle.db.

One file per target, keyed by relative path. Avoids per-file sidecar proliferation and inode waste for large files.

Re-exports§

pub use crate::constants::MERKLE_INDEX_CHUNK_SIZE as LARGE_FILE_CHUNK_SIZE;
pub use crate::constants::MERKLE_INDEX_THRESHOLD as INDEX_THRESHOLD;

Structs§

FlushGuard
RAII guard that calls flush_all() on drop for daemon shutdown safety.

Functions§

batch_set
Insert into the in-memory index WITHOUT flushing to disk. Caller must call flush() or flush_all() explicitly to persist.
flush
Explicitly flush a single target’s index to disk (crash-safe).
flush_all
Flush ALL targets in the global index cache to disk.
flush_guard
Create a FlushGuard that flushes all indexes on drop.
get
Retrieve a Merkle signature from the per-target index.
invalidate_cache
Invalidate the in-memory cache for a target (e.g., on target reconnect).
remove
Remove a Merkle signature from the index (file deleted or moved).
set
Store a Merkle signature in the per-target index (auto-flushes to disk).