Ext2Node

Struct Ext2Node 

Source
pub struct Ext2Node {
    inode_number: u32,
    file_type: FileType,
    file_id: u64,
    filesystem: RwLock<Option<Weak<dyn FileSystemOperations>>>,
}
Expand description

ext2 VFS Node

Represents a file or directory in the ext2 filesystem. This node implements the VfsNode trait and provides access to ext2-specific file operations.

Fields§

§inode_number: u32

Inode number in the ext2 filesystem

§file_type: FileType

File type (directory, regular file, etc.)

§file_id: u64

Unique file ID for VFS

§filesystem: RwLock<Option<Weak<dyn FileSystemOperations>>>

Weak reference to the filesystem

Implementations§

Source§

impl Ext2Node

Source

pub fn new(inode_number: u32, file_type: FileType, file_id: u64) -> Self

Create a new ext2 node

Source

pub fn inode_number(&self) -> u32

Get the inode number

Source

pub fn set_filesystem(&self, fs: Weak<dyn FileSystemOperations>)

Set the filesystem reference

Source

pub fn filesystem(&self) -> Option<Weak<dyn FileSystemOperations>>

Get the filesystem reference

Trait Implementations§

Source§

impl Debug for Ext2Node

Source§

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

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

impl VfsNode for Ext2Node

Source§

fn id(&self) -> u64

Returns the unique identifier in the filesystem
Source§

fn filesystem(&self) -> Option<Weak<dyn FileSystemOperations>>

Returns a (Weak) reference to the filesystem this node belongs to
Source§

fn file_type(&self) -> Result<FileType, FileSystemError>

Get the file type of this node
Source§

fn metadata(&self) -> Result<FileMetadata, FileSystemError>

Get metadata for this node
Source§

fn as_any(&self) -> &dyn Any

Helper for downcasting
Read the target of a symbolic link (returns error if not a symlink)
Source§

fn is_directory(&self) -> Result<bool, FileSystemError>

Returns true if this node is a directory
Returns true if this node is a symbolic link

Auto Trait Implementations§

§

impl !Freeze for Ext2Node

§

impl !RefUnwindSafe for Ext2Node

§

impl Send for Ext2Node

§

impl Sync for Ext2Node

§

impl Unpin for Ext2Node

§

impl !UnwindSafe for Ext2Node

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.