Trait virtual_fs::FileSystem
source · pub trait FileSystem:
Debug
+ Send
+ Sync
+ 'static
+ Upcastable {
// Required methods
fn readlink(&self, path: &Path) -> Result<PathBuf>;
fn read_dir(&self, path: &Path) -> Result<ReadDir>;
fn create_dir(&self, path: &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>;
fn symlink_metadata(&self, path: &Path) -> Result<Metadata>;
fn remove_file(&self, path: &Path) -> Result<()>;
fn new_open_options(&self) -> OpenOptions<'_>;
fn mount(
&self,
name: String,
path: &Path,
fs: Box<dyn FileSystem + Send + Sync>,
) -> Result<()>;
}
Required Methods§
fn readlink(&self, path: &Path) -> Result<PathBuf>
fn read_dir(&self, path: &Path) -> Result<ReadDir>
fn create_dir(&self, path: &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>
sourcefn 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<'_>
fn mount( &self, name: String, path: &Path, fs: Box<dyn FileSystem + Send + Sync>, ) -> Result<()>
Implementations§
source§impl dyn FileSystem + 'static
impl dyn FileSystem + 'static
pub fn downcast_ref<T: 'static>(&self) -> Option<&T>
pub fn downcast_mut<T: 'static>(&mut self) -> Option<&mut T>
Implementors§
impl FileSystem for ArcFileSystem
impl FileSystem for EmptyFileSystem
impl FileSystem for virtual_fs::host_fs::FileSystem
Available on crate feature
host-fs
only.impl FileSystem for virtual_fs::mem_fs::FileSystem
impl FileSystem for PassthruFileSystem
impl FileSystem for StaticFileSystem
Available on crate feature
static-fs
only.impl FileSystem for WebcVolumeFileSystem
Available on crate feature
webc-fs
only.