Struct MountPoint

Source
pub struct MountPoint {
    pub id: MountId,
    pub mount_type: MountType,
    pub path: String,
    pub root: VfsEntryRef,
    pub parent: Option<Weak<MountPoint>>,
    pub parent_entry: Option<VfsEntryRef>,
    pub children: Arc<RwLock<BTreeMap<u64, Arc<MountPoint>>>>,
}
Expand description

Mount point information

Fields§

§id: MountId

Unique mount ID

§mount_type: MountType

Type of mount

§path: String

Mount path (relative to parent mount)

§root: VfsEntryRef

Root entry of the mounted filesystem

§parent: Option<Weak<MountPoint>>

Parent mount (weak reference to avoid cycles)

§parent_entry: Option<VfsEntryRef>

Parent entry (strong reference to the VFS entry at the mount point to ensure it stays alive)

§children: Arc<RwLock<BTreeMap<u64, Arc<MountPoint>>>>

Child mounts: shared map of VfsEntry ID to MountPoint

Implementations§

Source§

impl MountPoint

Source

pub fn new_regular(path: String, root: VfsEntryRef) -> Arc<Self>

Create a new regular mount point

Source

pub fn new_bind(path: String, source: VfsEntryRef) -> Arc<Self>

Create a new bind mount point

Source

pub fn new_overlay( path: String, layers: Vec<VfsEntryRef>, ) -> VfsResult<Arc<Self>>

Create a new overlay mount point

Source

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

Get the parent mount point

Source

pub fn is_root_mount(&self) -> bool

Check if this is the root mount

Source

pub fn get_child(&self, entry: &VfsEntryRef) -> Option<Arc<MountPoint>>

Get child mount by VfsEntry

Source

pub fn add_child( self: &Arc<Self>, entry: &VfsEntryRef, child: Arc<MountPoint>, ) -> VfsResult<()>

Add a child mount by VfsEntry

Source

pub fn remove_child(&self, entry: &VfsEntryRef) -> Option<Arc<MountPoint>>

Remove a child mount by VfsEntry

Source

pub fn list_children(&self) -> Vec<u64>

List all child mount IDs

Source

pub fn is_bind_mount(&self) -> bool

Check if this mount point is a bind mount

Source

pub fn get_bind_source(&self) -> Option<VfsEntryRef>

Get the bind source entry (for regular bind mounts only)

Source

pub fn get_cross_vfs_info(&self) -> Option<(Weak<VfsManager>, &str, u64)>

Get cross-VFS bind information

Trait Implementations§

Source§

impl Debug for MountPoint

Source§

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

Formats the value using the given formatter. 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> 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.