MountFileSystem

Struct MountFileSystem 

Source
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

Source

pub fn new() -> Self

Source

pub fn mount( &self, path: impl AsRef<Path>, fs: Arc<dyn FileSystem + Send + Sync>, ) -> Result<()>

Source

pub fn mount_with_source( &self, path: impl AsRef<Path>, source_path: impl AsRef<Path>, fs: Arc<dyn FileSystem + Send + Sync>, ) -> Result<()>

Source

pub fn filesystem_at( &self, path: impl AsRef<Path>, ) -> Option<Arc<dyn FileSystem + Send + Sync>>

Source

pub fn clear(&mut self)

Source

fn prepare_path(&self, path: &Path) -> Result<PathBuf>

Source

fn path_components(path: &Path) -> Vec<OsString>

Source

fn absolute_path(components: &[OsString]) -> PathBuf

Source

fn normalize_source_path(path: &Path) -> PathBuf

Source

fn directory_metadata() -> Metadata

Source

fn should_fallback_to_synthetic_dir(error: &FsError) -> bool

Source

fn synthetic_entry(name: OsString, base: &Path) -> DirEntry

Source

fn mounted(node: &MountNode) -> Option<MountedFileSystem>

Source

fn collect_mount_entries( node: &MountNode, path: &Path, entries: &mut Vec<MountEntry>, )

Source

fn find_node<'a>( node: &'a MountNode, components: &[OsString], ) -> Option<&'a MountNode>

Source

fn exact_node(&self, path: &Path) -> Option<ExactNode>

Source

fn resolve_mount(&self, path: impl AsRef<Path>) -> Option<ResolvedMount>

Source

fn rebase_entries( entries: &mut ReadDir, source_prefix: &Path, target_prefix: &Path, )

Source

fn read_dir_from_exact_node(&self, node: &ExactNode) -> Result<ReadDir>

Source

fn mount_node_mut<'a>( node: &'a mut MountNode, components: &[OsString], ) -> &'a mut MountNode

Source

fn clear_descendants(node: &mut MountNode)

Source

pub fn set_mount( &self, path: impl AsRef<Path>, fs: Arc<dyn FileSystem + Send + Sync>, ) -> Result<()>

Overwrite the mount at path.

Source

pub fn add_mount_entries_with_mode( &self, entries: impl IntoIterator<Item = MountEntry>, conflict_mode: ExactMountConflictMode, ) -> Result<()>

Source

pub fn mount_entries(&self) -> Vec<MountEntry>

Trait Implementations§

Source§

impl Debug for MountFileSystem

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for MountFileSystem

Source§

fn default() -> MountFileSystem

Returns the “default value” for a type. Read more
Source§

impl FileOpener for MountFileSystem

Source§

fn open( &self, path: &Path, conf: &OpenOptionsConfig, ) -> Result<Box<dyn VirtualFile + Send + Sync>>

Source§

impl FileSystem for MountFileSystem

Source§

fn read_dir(&self, path: &Path) -> Result<ReadDir>

Source§

fn create_dir(&self, path: &Path) -> Result<()>

Source§

fn remove_dir(&self, path: &Path) -> Result<()>

Source§

fn rename<'a>( &'a self, from: &'a Path, to: &'a Path, ) -> BoxFuture<'a, Result<()>>

Source§

fn 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.
Source§

fn remove_file(&self, path: &Path) -> Result<()>

Source§

fn new_open_options(&self) -> OpenOptions<'_>

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

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

Source§

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> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.
Source§

impl<T> Upcastable for T
where T: Any + Debug + 'static,

Source§

fn upcast_any_ref(&self) -> &(dyn Any + 'static)

Source§

fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)

Source§

fn upcast_any_box(self: Box<T>) -> Box<dyn Any>

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more