⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

FileManifest

Struct FileManifest 

Source
pub struct FileManifest { /* private fields */ }
Expand description

A record of files installed by a package

Implementations§

Source§

impl FileManifest

Source

pub fn new() -> Self

Source

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.

Source

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.

Source

pub fn get_package_files(&self, package: &str) -> Option<&[FileRecord]>

Get all files belonging to a package.

Source

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.

Source

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.

Source

pub fn list_config_files(&self, package: &str) -> Vec<&FileRecord>

List only configuration files for a package.

Source

pub fn list_doc_files(&self, package: &str) -> Vec<&FileRecord>

List only documentation files for a package.

Source

pub fn package_count(&self) -> usize

Return the total number of tracked packages.

Trait Implementations§

Source§

impl Default for FileManifest

Available on crate feature alloc only.
Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl Freeze for FileManifest

§

impl RefUnwindSafe for FileManifest

§

impl Send for FileManifest

§

impl Sync for FileManifest

§

impl Unpin for FileManifest

§

impl UnwindSafe for FileManifest

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.