pub struct FileSystem<T> {
pub root: Directory<T>,
pub have_root_stat: bool,
}Expand description
A complete filesystem tree with a root directory.
Fields§
§root: Directory<T>The root directory of the filesystem.
have_root_stat: boolWhether the root directory’s metadata has been explicitly set.
Implementations§
Source§impl<ObjectID: FsVerityHashValue> FileSystem<RegularFile<ObjectID>>
impl<ObjectID: FsVerityHashValue> FileSystem<RegularFile<ObjectID>>
Sourcepub fn commit_image(
&mut self,
repository: &Repository<ObjectID>,
image_name: Option<&str>,
) -> Result<ObjectID>
pub fn commit_image( &mut self, repository: &Repository<ObjectID>, image_name: Option<&str>, ) -> Result<ObjectID>
Commits this filesystem as an EROFS image to the repository.
Ensures the root directory stat is computed, generates an EROFS filesystem image, and writes it to the repository with the optional name. Returns the fsverity digest of the committed image.
Sourcepub fn compute_image_id(&mut self) -> ObjectID
pub fn compute_image_id(&mut self) -> ObjectID
Computes the fsverity digest for this filesystem as an EROFS image.
Ensures the root directory stat is computed, generates the EROFS image, and returns its fsverity digest without writing to a repository.
Sourcepub fn print_dumpfile(&mut self) -> Result<()>
pub fn print_dumpfile(&mut self) -> Result<()>
Prints this filesystem in dumpfile format to stdout.
Ensures the root directory stat is computed and serializes the entire filesystem tree to stdout in composefs dumpfile text format.
Source§impl<T> FileSystem<T>
impl<T> FileSystem<T>
Sourcepub fn set_root_stat(&mut self, stat: Stat)
pub fn set_root_stat(&mut self, stat: Stat)
Sets the metadata for the root directory.
Marks the root directory’s stat as explicitly set.
Sourcepub fn ensure_root_stat(&mut self)
pub fn ensure_root_stat(&mut self)
Ensures the root directory has valid metadata.
If the root stat hasn’t been explicitly set, this computes it by finding the newest modification time in the entire filesystem tree.