Skip to main content

FileSystem

Trait FileSystem 

Source
pub(crate) trait FileSystem:
    Debug
    + Send
    + Sync
    + 'static
    + Upcastable {
    // Required methods
    fn readlink(&self, path: &Path) -> Result<PathBuf, FsError>;
    fn read_dir(&self, path: &Path) -> Result<ReadDir, FsError>;
    fn create_dir(&self, path: &Path) -> Result<(), FsError>;
    fn remove_dir(&self, path: &Path) -> Result<(), FsError>;
    fn rename<'a>(
        &'a self,
        from: &'a Path,
        to: &'a Path,
    ) -> Pin<Box<dyn Future<Output = Result<(), FsError>> + Send + 'a>>;
    fn metadata(&self, path: &Path) -> Result<Metadata, FsError>;
    fn symlink_metadata(&self, path: &Path) -> Result<Metadata, FsError>;
    fn remove_file(&self, path: &Path) -> Result<(), FsError>;
    fn new_open_options(&self) -> OpenOptions<'_>;

    // Provided methods
    fn create_symlink(
        &self,
        _source: &Path,
        _target: &Path,
    ) -> Result<(), FsError> { ... }
    fn hard_link(&self, _source: &Path, _target: &Path) -> Result<(), FsError> { ... }
}

Required Methods§

Source

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

Source

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

Source

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

Source

fn rename<'a>( &'a self, from: &'a Path, to: &'a Path, ) -> Pin<Box<dyn Future<Output = Result<(), FsError>> + Send + 'a>>

Source

fn metadata(&self, path: &Path) -> Result<Metadata, FsError>

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<(), FsError>

Source

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

Provided Methods§

Implementations§

Source§

impl dyn FileSystem

Source

pub fn downcast_ref<T>(&self) -> Option<&T>
where T: 'static,

Source

pub fn downcast_mut<T>(&mut self) -> Option<&mut T>
where T: 'static,

Implementors§

Source§

impl FileSystem for ArcFileSystem

Source§

impl FileSystem for EmptyFileSystem

Source§

impl FileSystem for virtual_fs::host_fs::FileSystem

Source§

impl FileSystem for virtual_fs::mem_fs::filesystem::FileSystem

Source§

impl FileSystem for MountFileSystem

Source§

impl FileSystem for PassthruFileSystem

Source§

impl FileSystem for TmpFileSystem

Source§

impl FileSystem for WebcVolumeFileSystem

Source§

impl FileSystem for FallbackFileSystem

Source§

impl FileSystem for WasiFsRoot

Source§

impl<D, F> FileSystem for D
where D: Deref<Target = F> + Debug + Send + Sync + 'static, F: FileSystem + ?Sized,

Source§

impl<F> FileSystem for TraceFileSystem<F>
where F: FileSystem,

Source§

impl<P, S> FileSystem for OverlayFileSystem<P, S>
where P: FileSystem + Send + 'static, S: for<'a> FileSystems<'a> + Send + Sync + 'static, <<S as FileSystems<'a>>::Iter as IntoIterator>::IntoIter: for<'a> Send,