Struct MountPoint

Source
pub struct MountPoint {
    pub path: String,
    pub fs: FileSystemRef,
    pub fs_id: usize,
    pub mount_type: MountType,
    pub mount_options: MountOptions,
    pub parent: Option<String>,
    pub children: Vec<String>,
    pub mount_time: u64,
}
Expand description

Extended mount point information

MountPoint contains comprehensive information about a mounted filesystem, including metadata, mount options, and relationship information for hierarchical mount management.

§Features

  • Filesystem Integration: Direct reference to the mounted filesystem
  • Mount Hierarchy: Parent/child relationships for mount tree management
  • Security Options: Configurable mount options for access control
  • Bind Mount Support: Resolves bind mount chains to actual filesystems
  • Metadata Tracking: Mount time and filesystem identification

§Thread Safety

MountPoint is designed to be shared safely between threads using Arc wrapper when stored in the mount tree.

Fields§

§path: String

Absolute mount path in the filesystem hierarchy

§fs: FileSystemRef

Reference to the actual filesystem implementation

§fs_id: usize

VfsManager-assigned filesystem identifier

§mount_type: MountType

Type of mount (regular, bind, overlay)

§mount_options: MountOptions

Security and behavior options for this mount

§parent: Option<String>

Parent mount path (None for root mount)

§children: Vec<String>

List of child mount paths

§mount_time: u64

Timestamp when this mount was created

Implementations§

Source§

impl MountPoint

Source

pub fn resolve_fs(&self, relative_path: &str) -> Result<(FileSystemRef, String)>

Resolve filesystem and internal path from MountPoint

This method resolves bind mount chains to find the actual filesystem that handles the requested path. For regular mounts, it returns the filesystem directly. For bind mounts, it recursively follows the bind chain to the source filesystem.

§Arguments
  • relative_path - Path relative to this mount point
§Returns
  • Ok((FileSystemRef, String)) - The actual filesystem and the resolved path within it
  • Err(FileSystemError) - If bind mount resolution fails or exceeds recursion limit
§Note

This method only supports Regular, Tmpfs, and Overlay mounts. Bind mounts are resolved transparently to their source filesystems.

Source

fn resolve_fs_with_depth( &self, relative_path: &str, depth: usize, ) -> Result<(FileSystemRef, String)>

Internal method for bind mount resolution with recursion depth tracking

This method prevents infinite recursion in circular bind mount chains by limiting the maximum recursion depth to 32 levels.

§Arguments
  • relative_path - Path relative to this mount point
  • depth - Current recursion depth for loop detection
§Returns
  • Ok((FileSystemRef, String)) - The actual filesystem and resolved path
  • Err(FileSystemError) - If recursion limit exceeded or resolution fails

Trait Implementations§

Source§

impl Clone for MountPoint

Source§

fn clone(&self) -> MountPoint

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl Freeze for MountPoint

§

impl !RefUnwindSafe for MountPoint

§

impl Send for MountPoint

§

impl Sync for MountPoint

§

impl Unpin for MountPoint

§

impl !UnwindSafe for MountPoint

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> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

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.