MountTable

Struct MountTable 

Source
pub struct MountTable {
    mounts: SpinLock<BTreeMap<String, Vec<Arc<MountPoint>>>>,
}
Expand description

全局挂载表

Fields§

§mounts: SpinLock<BTreeMap<String, Vec<Arc<MountPoint>>>>

挂载路径 -> 挂载点栈(最后一个是当前可见的)

Implementations§

Source§

impl MountTable

Source

pub const fn new() -> Self

创建新的挂载表

Source

pub fn mount( &self, fs: Arc<dyn FileSystem>, path: &str, flags: MountFlags, device: Option<String>, ) -> Result<(), FsError>

挂载文件系统

Source

pub fn umount(&self, path: &str) -> Result<(), FsError>

卸载文件系统

Source

pub fn find_mount(&self, path: &str) -> Option<Arc<MountPoint>>

查找给定路径的挂载点

返回最长匹配的挂载点(栈顶)

Source

pub fn root_mount(&self) -> Option<Arc<MountPoint>>

获取根挂载点

Source

pub fn list_mounts(&self) -> Vec<(String, String)>

列出所有挂载点(用于调试)

Source

pub fn list_all(&self) -> BTreeMap<String, Arc<MountPoint>>

Auto Trait Implementations§

§

impl !Freeze for MountTable

§

impl !RefUnwindSafe for MountTable

§

impl Send for MountTable

§

impl Sync for MountTable

§

impl Unpin for MountTable

§

impl !UnwindSafe for MountTable

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.