Trait rcore_fs::vfs::INode [−][src]
Abstract file system object such as file or directory.
Required methods
fn read_at(&self, offset: usize, buf: &mut [u8]) -> Result<usize>[src]
Read bytes at offset into buf, return the number of bytes read.
fn write_at(&self, offset: usize, buf: &[u8]) -> Result<usize>[src]
Write bytes at offset from buf, return the number of bytes written.
fn poll(&self) -> Result<PollStatus>[src]
Poll the events, return a bitmap of events.
fn as_any_ref(&self) -> &dyn Any[src]
This is used to implement dynamics cast. Simply return self in the implement of the function.
Provided methods
fn async_poll<'a>(
&'a self
) -> Pin<Box<dyn Future<Output = Result<PollStatus>> + Send + Sync + 'a>>[src]
&'a self
) -> Pin<Box<dyn Future<Output = Result<PollStatus>> + Send + Sync + 'a>>
Poll the events, return a bitmap of events, async version.
fn metadata(&self) -> Result<Metadata>[src]
Get metadata of the INode
fn set_metadata(&self, _metadata: &Metadata) -> Result<()>[src]
Set metadata of the INode
fn sync_all(&self) -> Result<()>[src]
Sync all data and metadata
fn sync_data(&self) -> Result<()>[src]
Sync data (not include metadata)
fn resize(&self, _len: usize) -> Result<()>[src]
Resize the file
fn create(
&self,
name: &str,
type_: FileType,
mode: u32
) -> Result<Arc<dyn INode>>[src]
&self,
name: &str,
type_: FileType,
mode: u32
) -> Result<Arc<dyn INode>>
Create a new INode in the directory
fn create2(
&self,
name: &str,
type_: FileType,
mode: u32,
_data: usize
) -> Result<Arc<dyn INode>>[src]
&self,
name: &str,
type_: FileType,
mode: u32,
_data: usize
) -> Result<Arc<dyn INode>>
Create a new INode in the directory, with a data field for usages like device file.
fn link(&self, _name: &str, _other: &Arc<dyn INode>) -> Result<()>[src]
Create a hard link name to other
fn unlink(&self, _name: &str) -> Result<()>[src]
Delete a hard link name
fn move_(
&self,
_old_name: &str,
_target: &Arc<dyn INode>,
_new_name: &str
) -> Result<()>[src]
&self,
_old_name: &str,
_target: &Arc<dyn INode>,
_new_name: &str
) -> Result<()>
Move INode self/old_name to target/new_name.
If target equals self, do rename.
fn find(&self, _name: &str) -> Result<Arc<dyn INode>>[src]
Find the INode name in the directory
fn get_entry(&self, _id: usize) -> Result<String>[src]
Get the name of directory entry
fn get_entry_with_metadata(&self, id: usize) -> Result<(Metadata, String)>[src]
Get the name of directory entry with metadata
fn io_control(&self, _cmd: u32, _data: usize) -> Result<usize>[src]
Control device
fn mmap(&self, _area: MMapArea) -> Result<()>[src]
Map files or devices into memory
fn fs(&self) -> Arc<dyn FileSystem>[src]
Get the file system of the INode
Implementations
impl dyn INode[src]
pub fn downcast_ref<T: INode>(&self) -> Option<&T>[src]
Downcast the INode to specific struct
pub fn list(&self) -> Result<Vec<String>>[src]
Get all directory entries as a Vec
pub fn lookup(&self, path: &str) -> Result<Arc<dyn INode>>[src]
Lookup path from current INode, and do not follow symlinks
pub fn lookup_follow(
&self,
path: &str,
follow_times: usize
) -> Result<Arc<dyn INode>>[src]
&self,
path: &str,
follow_times: usize
) -> Result<Arc<dyn INode>>
Lookup path from current INode, and follow symlinks at most follow_times times