FileSystem

Struct FileSystem 

Source
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: bool

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

Implementations§

Source§

impl<ObjectID: FsVerityHashValue> FileSystem<RegularFile<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.

Source§

impl<T> FileSystem<T>

Source

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.

Source

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.

Trait Implementations§

Source§

impl<T: Debug> Debug for FileSystem<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T> Default for FileSystem<T>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<T> !Freeze for FileSystem<T>

§

impl<T> !RefUnwindSafe for FileSystem<T>

§

impl<T> !Send for FileSystem<T>

§

impl<T> !Sync for FileSystem<T>

§

impl<T> Unpin for FileSystem<T>

§

impl<T> !UnwindSafe for FileSystem<T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V