FileSystem

Type Alias FileSystem 

Source
pub type FileSystem<T> = FileSystem<RegularFile<T>>;
Expand description

A complete filesystem tree, specialized for composefs regular files.

Aliased Type§

pub struct FileSystem<T> {
    pub root: Directory<RegularFile<T>>,
    pub have_root_stat: bool,
}

Fields§

§root: Directory<RegularFile<T>>

The root directory of the filesystem.

§have_root_stat: bool

Whether the root directory’s metadata has been explicitly set.

Implementations§

Source§

impl<ObjectID: FsVerityHashValue> FileSystem<ObjectID>

Source

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.

Source

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.

Source

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.