pub trait INode: Any + Sync + Send {
Show 21 methods fn read_at(&self, offset: usize, buf: &mut [u8]) -> Result<usize, FsError>; fn write_at(&self, offset: usize, buf: &[u8]) -> Result<usize, FsError>; fn poll(&self) -> Result<PollStatus, FsError>; fn as_any_ref(&self) -> &(dyn Any + 'static); fn async_poll(
        &'a self
    ) -> Pin<Box<dyn Future<Output = Result<PollStatus, FsError>> + Sync + Send + 'a, Global>> { ... } fn metadata(&self) -> Result<Metadata, FsError> { ... } fn set_metadata(&self, _metadata: &Metadata) -> Result<(), FsError> { ... } fn sync_all(&self) -> Result<(), FsError> { ... } fn sync_data(&self) -> Result<(), FsError> { ... } fn resize(&self, _len: usize) -> Result<(), FsError> { ... } fn create(
        &self,
        name: &str,
        type_: FileType,
        mode: u32
    ) -> Result<Arc<dyn INode + 'static>, FsError> { ... } fn create2(
        &self,
        name: &str,
        type_: FileType,
        mode: u32,
        _data: usize
    ) -> Result<Arc<dyn INode + 'static>, FsError> { ... } fn link(
        &self,
        _name: &str,
        _other: &Arc<dyn INode + 'static>
    ) -> Result<(), FsError> { ... } fn unlink(&self, _name: &str) -> Result<(), FsError> { ... } fn move_(
        &self,
        _old_name: &str,
        _target: &Arc<dyn INode + 'static>,
        _new_name: &str
    ) -> Result<(), FsError> { ... } fn find(&self, _name: &str) -> Result<Arc<dyn INode + 'static>, FsError> { ... } fn get_entry(&self, _id: usize) -> Result<String, FsError> { ... } fn get_entry_with_metadata(
        &self,
        id: usize
    ) -> Result<(Metadata, String), FsError> { ... } fn io_control(&self, _cmd: u32, _data: usize) -> Result<usize, FsError> { ... } fn mmap(&self, _area: MMapArea) -> Result<(), FsError> { ... } fn fs(&self) -> Arc<dyn FileSystem + 'static> { ... }
}
Expand description

Abstract file system object such as file or directory.

Required Methods

Read bytes at offset into buf, return the number of bytes read.

Write bytes at offset from buf, return the number of bytes written.

Poll the events, return a bitmap of events.

This is used to implement dynamics cast. Simply return self in the implement of the function.

Provided Methods

Poll the events, return a bitmap of events, async version.

Get metadata of the INode

Set metadata of the INode

Sync all data and metadata

Sync data (not include metadata)

Resize the file

Create a new INode in the directory

Create a new INode in the directory, with a data field for usages like device file.

Create a hard link name to other

Delete a hard link name

Move INode self/old_name to target/new_name. If target equals self, do rename.

Find the INode name in the directory

fn get_entry(&self, _id: usize) -> Result<String, FsError>

Get the name of directory entry

fn get_entry_with_metadata(
    &self,
    id: usize
) -> Result<(Metadata, String), FsError>

Get the name of directory entry with metadata

Control device

Map files or devices into memory

Get the file system of the INode

Implementations

Downcast the INode to specific struct

Get all directory entries as a Vec

Lookup path from current INode, and do not follow symlinks

Lookup path from current INode, and follow symlinks at most follow_times times

Trait Implementations

similar to read, but return a u8 vector

Implementations on Foreign Types

fn get_entry(&self, id: usize) -> Result<String, FsError>

fn get_entry(&self, _id: usize) -> Result<String, FsError>

fn get_entry(&self, _id: usize) -> Result<String, FsError>

Poll the events, return a bitmap of events, async version.

fn get_entry(&self, id: usize) -> Result<String, FsError>

fn get_entry_with_metadata(
    &self,
    id: usize
) -> Result<(Metadata, String), FsError>

Implementors