Trait FileSystem

Source
pub trait FileSystem:
    Debug
    + Send
    + Sync
    + 'static
    + Upcastable {
    // Required methods
    fn read_dir(&self, path: &Path) -> Result<ReadDir>;
    fn create_dir(&self, path: &Path) -> Result<()>;
    fn remove_dir(&self, path: &Path) -> Result<()>;
    fn rename(&self, from: &Path, to: &Path) -> Result<()>;
    fn metadata(&self, path: &Path) -> Result<Metadata>;
    fn remove_file(&self, path: &Path) -> Result<()>;
    fn new_open_options(&self) -> OpenOptions;

    // Provided method
    fn symlink_metadata(&self, path: &Path) -> Result<Metadata> { ... }
}

Required Methods§

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(&self, from: &Path, to: &Path) -> Result<()>

Source

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

Source

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

Source

fn new_open_options(&self) -> OpenOptions

Provided Methods§

This method gets metadata without following symlinks in the path. Currently identical to metadata because symlinks aren’t implemented yet.

Implementations§

Source§

impl dyn FileSystem + 'static

Source

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

Source

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

Implementors§

Source§

impl FileSystem for wasmer_vfs::host_fs::FileSystem

Source§

impl FileSystem for wasmer_vfs::mem_fs::FileSystem

Source§

impl FileSystem for StaticFileSystem

Source§

impl<T> FileSystem for WebcFileSystem<T>
where T: Debug + Send + Sync + 'static + Deref<Target = WebC<'static>>,