Skip to main content

KernInode

Struct KernInode 

Source
pub struct KernInode { /* private fields */ }
Expand description

内核文件系统节点

Implementations§

Source§

impl KernInode

Source

pub fn new_dir() -> Arc<Self>

创建目录节点

Source

pub fn new_file( read: Option<ReadCallback>, write: Option<WriteCallback>, ) -> Arc<Self>

创建文件节点

Source

pub fn new_device(device: Arc<Device>) -> Arc<Self>

创建设备节点

Source

pub fn add_child( &self, name: &str, child: Arc<KernInode>, ) -> Result<(), VfsError>

添加子节点(仅目录节点可用)

Trait Implementations§

Source§

impl Debug for KernInode

Source§

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

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

impl Inode for KernInode

Source§

fn metadata(&self) -> Result<Metadata, VfsError>

Source§

fn set_metadata(&self, _metadata: &Metadata) -> Result<(), VfsError>

Source§

fn node_type(&self) -> VNodeType

Source§

fn read_at(&self, offset: u64, buf: &mut [u8]) -> Result<usize, VfsError>

Source§

fn write_at(&self, offset: u64, buf: &[u8]) -> Result<usize, VfsError>

Source§

fn truncate(&self, _size: u64) -> Result<(), VfsError>

Source§

fn sync(&self) -> Result<(), VfsError>

Source§

fn lookup(&self, name: &str) -> Result<Arc<dyn Inode>, VfsError>

Source§

fn create(&self, name: &str, typ: VNodeType) -> Result<Arc<dyn Inode>, VfsError>

Source§

fn create_device( &self, name: &str, device: Arc<Device>, ) -> Result<Arc<dyn Inode>, VfsError>

Source§

fn list(&self) -> Result<Vec<String>, VfsError>

Source§

fn as_any(&self) -> &dyn Any

Source§

fn rename(&self, old_name: &str, new_name: &str) -> Result<(), VfsError>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.