Struct CpioFS

Source
pub struct CpioFS {
    root_node: Arc<CpioNode>,
    name: String,
}
Expand description

CPIO filesystem implementation

Fields§

§root_node: Arc<CpioNode>

Root node of the filesystem

§name: String

Filesystem name

Implementations§

Source§

impl CpioFS

Source

pub fn new(name: String, cpio_data: &[u8]) -> Result<Arc<Self>, FileSystemError>

Create a new CpioFS from CPIO archive data

Source

pub fn create_from_option_string( option: Option<&str>, cpio_data: &[u8], ) -> Arc<dyn FileSystemOperations>

VFS v2 driver registration API: create from option string Example: option = Some(“initramfs_addr=0x80000000,size=65536”)

Source

fn parse_cpio_archive( self: &Arc<Self>, data: &[u8], ) -> Result<(), FileSystemError>

Parse CPIO archive and build directory tree

Trait Implementations§

Source§

impl FileSystemOperations for CpioFS

Source§

fn lookup( &self, parent_node: &Arc<dyn VfsNode>, name: &String, ) -> Result<Arc<dyn VfsNode>, FileSystemError>

Look up a child node by name within a parent directory Read more
Source§

fn open( &self, node: &Arc<dyn VfsNode>, _flags: u32, ) -> Result<Arc<dyn FileObject>, FileSystemError>

Open a file represented by a VfsNode Read more
Source§

fn create( &self, _parent_node: &Arc<dyn VfsNode>, _name: &String, _file_type: FileType, _mode: u32, ) -> Result<Arc<dyn VfsNode>, FileSystemError>

Create a new file in the specified directory
Source§

fn remove( &self, _parent_node: &Arc<dyn VfsNode>, _name: &String, ) -> Result<(), FileSystemError>

Remove a file from the specified directory
Source§

fn root_node(&self) -> Arc<dyn VfsNode>

Get the root VfsNode for this filesystem
Source§

fn name(&self) -> &str

Get filesystem name
Source§

fn is_read_only(&self) -> bool

Check if filesystem is read-only
Source§

fn readdir( &self, node: &Arc<dyn VfsNode>, ) -> Result<Vec<DirectoryEntryInternal>, FileSystemError>

Read directory entries from a directory node
Create a hard link to an existing file Read more

Auto Trait Implementations§

§

impl Freeze for CpioFS

§

impl !RefUnwindSafe for CpioFS

§

impl Send for CpioFS

§

impl Sync for CpioFS

§

impl Unpin for CpioFS

§

impl !UnwindSafe for CpioFS

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.