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
impl MountPoint
Sourcepub fn new_regular(path: String, root: VfsEntryRef) -> Arc<Self>
pub fn new_regular(path: String, root: VfsEntryRef) -> Arc<Self>
Create a new regular mount point
Sourcepub fn new_bind(path: String, source: VfsEntryRef) -> Arc<Self>
pub fn new_bind(path: String, source: VfsEntryRef) -> Arc<Self>
Create a new bind mount point
Sourcepub fn new_overlay(
path: String,
layers: Vec<VfsEntryRef>,
) -> VfsResult<Arc<Self>>
pub fn new_overlay( path: String, layers: Vec<VfsEntryRef>, ) -> VfsResult<Arc<Self>>
Create a new overlay mount point
Sourcepub fn get_parent(&self) -> Option<Arc<MountPoint>>
pub fn get_parent(&self) -> Option<Arc<MountPoint>>
Get the parent mount point
Sourcepub fn is_root_mount(&self) -> bool
pub fn is_root_mount(&self) -> bool
Check if this is the root mount
Sourcepub fn get_child(&self, entry: &VfsEntryRef) -> Option<Arc<MountPoint>>
pub fn get_child(&self, entry: &VfsEntryRef) -> Option<Arc<MountPoint>>
Get child mount by VfsEntry
Sourcepub fn add_child(
self: &Arc<Self>,
entry: &VfsEntryRef,
child: Arc<MountPoint>,
) -> VfsResult<()>
pub fn add_child( self: &Arc<Self>, entry: &VfsEntryRef, child: Arc<MountPoint>, ) -> VfsResult<()>
Add a child mount by VfsEntry
Sourcepub fn remove_child(&self, entry: &VfsEntryRef) -> Option<Arc<MountPoint>>
pub fn remove_child(&self, entry: &VfsEntryRef) -> Option<Arc<MountPoint>>
Remove a child mount by VfsEntry
Sourcepub fn list_children(&self) -> Vec<u64>
pub fn list_children(&self) -> Vec<u64>
List all child mount IDs
Sourcepub fn is_bind_mount(&self) -> bool
pub fn is_bind_mount(&self) -> bool
Check if this mount point is a bind mount
Sourcepub fn get_bind_source(&self) -> Option<VfsEntryRef>
pub fn get_bind_source(&self) -> Option<VfsEntryRef>
Get the bind source entry (for regular bind mounts only)
Sourcepub fn get_cross_vfs_info(&self) -> Option<(Weak<VfsManager>, &str, u64)>
pub fn get_cross_vfs_info(&self) -> Option<(Weak<VfsManager>, &str, u64)>
Get cross-VFS bind information