pub struct TreeSnapshot {
checksum: Checksum,
entries: Vec<TreeEntry>,
total_bytes: u64,
}Expand description
A deterministic snapshot of an explicitly reviewed set of regular files.
Entries are normalized and sorted by relative path. The checksum includes a format version, relative paths, lengths, and content checksums. Input order has no effect. Adding, deleting, renaming, or editing a file changes the checksum.
Fields§
§checksum: Checksum§entries: Vec<TreeEntry>§total_bytes: u64Implementations§
Source§impl TreeSnapshot
impl TreeSnapshot
Sourcepub fn capture<I, P>(root: &Path, paths: I) -> Result<Self>
pub fn capture<I, P>(root: &Path, paths: I) -> Result<Self>
Capture an explicit set of files beneath a lexical root.
Paths normally come from one of crate::walk’s reviewed traversal policies.
Relative components must be valid UTF-8 for portable checksums.
Parent-directory symlinks are not resolved.
This operation establishes cache identity, not a containment boundary.
Use crate::containment first for paths originating from untrusted input.
§Errors
Returns an error for invalid, duplicate, missing, non-regular, or unreadable paths.
Sourcepub fn file_count(&self) -> usize
pub fn file_count(&self) -> usize
Return the number of captured files.
Sourcepub const fn total_bytes(&self) -> u64
pub const fn total_bytes(&self) -> u64
Return the sum of the captured file lengths.
Trait Implementations§
Source§impl Clone for TreeSnapshot
impl Clone for TreeSnapshot
Source§fn clone(&self) -> TreeSnapshot
fn clone(&self) -> TreeSnapshot
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more