pub struct FileManifest { /* private fields */ }Expand description
A record of files installed by a package
Implementations§
Source§impl FileManifest
impl FileManifest
pub fn new() -> Self
Sourcepub fn record_installation(&mut self, package: &str, files: Vec<FileRecord>)
pub fn record_installation(&mut self, package: &str, files: Vec<FileRecord>)
Record all files installed by a package.
Replaces any previous manifest for this package.
Sourcepub fn verify_installation(&self, package: &str) -> Result<bool, KernelError>
pub fn verify_installation(&self, package: &str) -> Result<bool, KernelError>
Verify installed files against the manifest.
Checks that every recorded file still exists and matches its
expected size. Returns Ok(true) if all files are intact,
Ok(false) if any file is missing or has a different size.
Sourcepub fn get_package_files(&self, package: &str) -> Option<&[FileRecord]>
pub fn get_package_files(&self, package: &str) -> Option<&[FileRecord]>
Get all files belonging to a package.
Sourcepub fn find_file_owner(&self, path: &str) -> Option<String>
pub fn find_file_owner(&self, path: &str) -> Option<String>
Find which package owns a given file path.
Returns the package name if any manifest entry contains the path.
Sourcepub fn remove_package(&mut self, package: &str) -> Option<Vec<FileRecord>>
pub fn remove_package(&mut self, package: &str) -> Option<Vec<FileRecord>>
Remove manifest entries for a package.
Returns the removed file records so the caller can clean up the actual files.
Sourcepub fn list_config_files(&self, package: &str) -> Vec<&FileRecord>
pub fn list_config_files(&self, package: &str) -> Vec<&FileRecord>
List only configuration files for a package.
Sourcepub fn list_doc_files(&self, package: &str) -> Vec<&FileRecord>
pub fn list_doc_files(&self, package: &str) -> Vec<&FileRecord>
List only documentation files for a package.
Sourcepub fn package_count(&self) -> usize
pub fn package_count(&self) -> usize
Return the total number of tracked packages.