Struct DevFS

Source
pub struct DevFS {
    root: RwLock<Arc<DevNode>>,
    name: String,
}
Expand description

DevFS - Device filesystem implementation

This filesystem automatically exposes all devices registered in the global DeviceManager as device files. It provides a virtual view of the system’s devices, similar to /dev in Unix-like systems.

Fields§

§root: RwLock<Arc<DevNode>>

Root directory node

§name: String

Filesystem name

Implementations§

Source§

impl DevFS

Source

pub fn new() -> Arc<Self>

Create a new DevFS instance

Source

fn populate_devices(&self) -> Result<(), FileSystemError>

Populate the filesystem with current devices from DeviceManager

Trait Implementations§

Source§

impl FileSystemOperations for DevFS

Source§

fn name(&self) -> &str

Get filesystem name
Source§

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

Get the root VfsNode for this filesystem
Source§

fn lookup( &self, parent: &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 readdir( &self, node: &Arc<dyn VfsNode>, ) -> Result<Vec<DirectoryEntryInternal>, FileSystemError>

Read directory entries from a directory node
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 is_read_only(&self) -> bool

Check if filesystem is read-only
Source§

fn create( &self, _parent: &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: &Arc<dyn VfsNode>, _name: &String, ) -> Result<(), FileSystemError>

Remove a file from the specified directory
Create a hard link to an existing file Read more

Auto Trait Implementations§

§

impl !Freeze for DevFS

§

impl !RefUnwindSafe for DevFS

§

impl Send for DevFS

§

impl Sync for DevFS

§

impl Unpin for DevFS

§

impl !UnwindSafe for DevFS

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.