pub struct MountFileSystem {
root: RwLock<MountNode>,
}Expand description
Allows different filesystems of different types to be mounted at various mount points
Fields§
§root: RwLock<MountNode>Implementations§
Source§impl MountFileSystem
impl MountFileSystem
pub fn new() -> Self
pub fn mount( &self, path: impl AsRef<Path>, fs: Arc<dyn FileSystem + Send + Sync>, ) -> Result<()>
pub fn mount_with_source( &self, path: impl AsRef<Path>, source_path: impl AsRef<Path>, fs: Arc<dyn FileSystem + Send + Sync>, ) -> Result<()>
pub fn filesystem_at( &self, path: impl AsRef<Path>, ) -> Option<Arc<dyn FileSystem + Send + Sync>>
pub fn clear(&mut self)
fn prepare_path(&self, path: &Path) -> Result<PathBuf>
fn path_components(path: &Path) -> Vec<OsString>
fn absolute_path(components: &[OsString]) -> PathBuf
fn normalize_source_path(path: &Path) -> PathBuf
fn directory_metadata() -> Metadata
fn should_fallback_to_synthetic_dir(error: &FsError) -> bool
fn synthetic_entry(name: OsString, base: &Path) -> DirEntry
fn mounted(node: &MountNode) -> Option<MountedFileSystem>
fn collect_mount_entries( node: &MountNode, path: &Path, entries: &mut Vec<MountEntry>, )
fn find_node<'a>( node: &'a MountNode, components: &[OsString], ) -> Option<&'a MountNode>
fn exact_node(&self, path: &Path) -> Option<ExactNode>
fn resolve_mount(&self, path: impl AsRef<Path>) -> Option<ResolvedMount>
fn rebase_entries( entries: &mut ReadDir, source_prefix: &Path, target_prefix: &Path, )
fn read_dir_from_exact_node(&self, node: &ExactNode) -> Result<ReadDir>
fn mount_node_mut<'a>( node: &'a mut MountNode, components: &[OsString], ) -> &'a mut MountNode
fn clear_descendants(node: &mut MountNode)
Sourcepub fn set_mount(
&self,
path: impl AsRef<Path>,
fs: Arc<dyn FileSystem + Send + Sync>,
) -> Result<()>
pub fn set_mount( &self, path: impl AsRef<Path>, fs: Arc<dyn FileSystem + Send + Sync>, ) -> Result<()>
Overwrite the mount at path.
pub fn add_mount_entries_with_mode( &self, entries: impl IntoIterator<Item = MountEntry>, conflict_mode: ExactMountConflictMode, ) -> Result<()>
pub fn mount_entries(&self) -> Vec<MountEntry>
Trait Implementations§
Source§impl Debug for MountFileSystem
impl Debug for MountFileSystem
Source§impl Default for MountFileSystem
impl Default for MountFileSystem
Source§fn default() -> MountFileSystem
fn default() -> MountFileSystem
Returns the “default value” for a type. Read more
Source§impl FileOpener for MountFileSystem
impl FileOpener for MountFileSystem
fn open( &self, path: &Path, conf: &OpenOptionsConfig, ) -> Result<Box<dyn VirtualFile + Send + Sync>>
Source§impl FileSystem for MountFileSystem
impl FileSystem for MountFileSystem
fn readlink(&self, path: &Path) -> Result<PathBuf>
fn read_dir(&self, path: &Path) -> Result<ReadDir>
fn create_dir(&self, path: &Path) -> Result<()>
fn create_symlink(&self, source: &Path, target: &Path) -> Result<()>
fn remove_dir(&self, path: &Path) -> Result<()>
fn rename<'a>( &'a self, from: &'a Path, to: &'a Path, ) -> BoxFuture<'a, Result<()>>
fn metadata(&self, path: &Path) -> Result<Metadata>
Source§fn symlink_metadata(&self, path: &Path) -> Result<Metadata>
fn symlink_metadata(&self, path: &Path) -> Result<Metadata>
This method gets metadata without following symlinks in the path.
Currently identical to
metadata because symlinks aren’t implemented
yet.fn remove_file(&self, path: &Path) -> Result<()>
fn new_open_options(&self) -> OpenOptions<'_>
Auto Trait Implementations§
impl !Freeze for MountFileSystem
impl RefUnwindSafe for MountFileSystem
impl Send for MountFileSystem
impl Sync for MountFileSystem
impl Unpin for MountFileSystem
impl UnwindSafe for MountFileSystem
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more