Struct axfs_ramfs::DirNode
source · pub struct DirNode { /* private fields */ }
Expand description
The directory node in the RAM filesystem.
It implements axfs_vfs::VfsNodeOps
.
Implementations§
source§impl DirNode
impl DirNode
sourcepub fn get_entries(&self) -> Vec<String>
pub fn get_entries(&self) -> Vec<String>
Returns a string list of all entries in this directory.
sourcepub fn exist(&self, name: &str) -> bool
pub fn exist(&self, name: &str) -> bool
Checks whether a node with the given name exists in this directory.
sourcepub fn create_node(&self, name: &str, ty: VfsNodeType) -> VfsResult
pub fn create_node(&self, name: &str, ty: VfsNodeType) -> VfsResult
Creates a new node with the given name and type in this directory.
sourcepub fn remove_node(&self, name: &str) -> VfsResult
pub fn remove_node(&self, name: &str) -> VfsResult
Removes a node by the given name in this directory.
Trait Implementations§
source§impl VfsNodeOps for DirNode
impl VfsNodeOps for DirNode
source§fn get_attr(&self) -> VfsResult<VfsNodeAttr>
fn get_attr(&self) -> VfsResult<VfsNodeAttr>
Get the attributes of the node.
source§fn lookup(self: Arc<Self>, path: &str) -> VfsResult<VfsNodeRef>
fn lookup(self: Arc<Self>, path: &str) -> VfsResult<VfsNodeRef>
Lookup the node with given
path
in the directory. Read moresource§fn read_dir(
&self,
start_idx: usize,
dirents: &mut [VfsDirEntry]
) -> VfsResult<usize>
fn read_dir( &self, start_idx: usize, dirents: &mut [VfsDirEntry] ) -> VfsResult<usize>
Read directory entries into
dirents
, starting from start_idx
.source§fn create(&self, path: &str, ty: VfsNodeType) -> VfsResult
fn create(&self, path: &str, ty: VfsNodeType) -> VfsResult
Create a new node with the given
path
in the directory Read moresource§fn remove(&self, path: &str) -> VfsResult
fn remove(&self, path: &str) -> VfsResult
Remove the node with the given
path
in the directory.source§fn read_at(&self, _offset: u64, _buf: &mut [u8]) -> VfsResult<usize>
fn read_at(&self, _offset: u64, _buf: &mut [u8]) -> VfsResult<usize>
Read data from the file at the given offset.
Auto Trait Implementations§
impl !RefUnwindSafe for DirNode
impl Send for DirNode
impl Sync for DirNode
impl Unpin for DirNode
impl !UnwindSafe for DirNode
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more