pub struct KernInode { /* private fields */ }Expand description
内核文件系统节点
Implementations§
Source§impl KernInode
impl KernInode
Sourcepub fn new_file(
read: Option<ReadCallback>,
write: Option<WriteCallback>,
) -> Arc<Self>
pub fn new_file( read: Option<ReadCallback>, write: Option<WriteCallback>, ) -> Arc<Self>
创建文件节点
Sourcepub fn new_device(device: Arc<Device>) -> Arc<Self>
pub fn new_device(device: Arc<Device>) -> Arc<Self>
创建设备节点
Trait Implementations§
Source§impl Inode for KernInode
impl Inode for KernInode
fn metadata(&self) -> Result<Metadata, VfsError>
fn set_metadata(&self, _metadata: &Metadata) -> Result<(), VfsError>
fn node_type(&self) -> VNodeType
fn read_at(&self, offset: u64, buf: &mut [u8]) -> Result<usize, VfsError>
fn write_at(&self, offset: u64, buf: &[u8]) -> Result<usize, VfsError>
fn truncate(&self, _size: u64) -> Result<(), VfsError>
fn sync(&self) -> Result<(), VfsError>
fn lookup(&self, name: &str) -> Result<Arc<dyn Inode>, VfsError>
fn create(&self, name: &str, typ: VNodeType) -> Result<Arc<dyn Inode>, VfsError>
fn create_device( &self, name: &str, device: Arc<Device>, ) -> Result<Arc<dyn Inode>, VfsError>
fn unlink(&self, name: &str) -> Result<(), VfsError>
fn list(&self) -> Result<Vec<String>, VfsError>
fn as_any(&self) -> &dyn Any
fn create_symlink( &self, name: &str, target: &str, ) -> Result<Arc<dyn Inode>, VfsError>
fn rename(&self, old_name: &str, new_name: &str) -> Result<(), VfsError>
fn read_symlink(&self) -> Result<String, VfsError>
Auto Trait Implementations§
impl !Freeze for KernInode
impl !RefUnwindSafe for KernInode
impl Send for KernInode
impl Sync for KernInode
impl Unpin for KernInode
impl !UnwindSafe for KernInode
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