pub trait FileSystem: Debug + MaybeSend + MaybeSync {
Show 44 methods
// Required methods
fn cwd(&self) -> FsResult<PathBuf>;
fn tmp_dir(&self) -> FsResult<PathBuf>;
fn chdir(&self, path: &Path) -> FsResult<()>;
fn umask(&self, mask: Option<u32>) -> FsResult<u32>;
fn open_sync(
&self,
path: &Path,
options: OpenOptions
) -> FsResult<Rc<dyn File>>;
fn open_async<'life0, 'async_trait>(
&'life0 self,
path: PathBuf,
options: OpenOptions
) -> Pin<Box<dyn Future<Output = FsResult<Rc<dyn File>>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn mkdir_sync(
&self,
path: &Path,
recursive: bool,
mode: u32
) -> FsResult<()>;
fn mkdir_async<'life0, 'async_trait>(
&'life0 self,
path: PathBuf,
recursive: bool,
mode: u32
) -> Pin<Box<dyn Future<Output = FsResult<()>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn chmod_sync(&self, path: &Path, mode: u32) -> FsResult<()>;
fn chmod_async<'life0, 'async_trait>(
&'life0 self,
path: PathBuf,
mode: u32
) -> Pin<Box<dyn Future<Output = FsResult<()>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn chown_sync(
&self,
path: &Path,
uid: Option<u32>,
gid: Option<u32>
) -> FsResult<()>;
fn chown_async<'life0, 'async_trait>(
&'life0 self,
path: PathBuf,
uid: Option<u32>,
gid: Option<u32>
) -> Pin<Box<dyn Future<Output = FsResult<()>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn remove_sync(&self, path: &Path, recursive: bool) -> FsResult<()>;
fn remove_async<'life0, 'async_trait>(
&'life0 self,
path: PathBuf,
recursive: bool
) -> Pin<Box<dyn Future<Output = FsResult<()>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn copy_file_sync(&self, oldpath: &Path, newpath: &Path) -> FsResult<()>;
fn copy_file_async<'life0, 'async_trait>(
&'life0 self,
oldpath: PathBuf,
newpath: PathBuf
) -> Pin<Box<dyn Future<Output = FsResult<()>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn stat_sync(&self, path: &Path) -> FsResult<FsStat>;
fn stat_async<'life0, 'async_trait>(
&'life0 self,
path: PathBuf
) -> Pin<Box<dyn Future<Output = FsResult<FsStat>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn lstat_sync(&self, path: &Path) -> FsResult<FsStat>;
fn lstat_async<'life0, 'async_trait>(
&'life0 self,
path: PathBuf
) -> Pin<Box<dyn Future<Output = FsResult<FsStat>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn realpath_sync(&self, path: &Path) -> FsResult<PathBuf>;
fn realpath_async<'life0, 'async_trait>(
&'life0 self,
path: PathBuf
) -> Pin<Box<dyn Future<Output = FsResult<PathBuf>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn read_dir_sync(&self, path: &Path) -> FsResult<Vec<FsDirEntry>>;
fn read_dir_async<'life0, 'async_trait>(
&'life0 self,
path: PathBuf
) -> Pin<Box<dyn Future<Output = FsResult<Vec<FsDirEntry>>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn rename_sync(&self, oldpath: &Path, newpath: &Path) -> FsResult<()>;
fn rename_async<'life0, 'async_trait>(
&'life0 self,
oldpath: PathBuf,
newpath: PathBuf
) -> Pin<Box<dyn Future<Output = FsResult<()>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn link_sync(&self, oldpath: &Path, newpath: &Path) -> FsResult<()>;
fn link_async<'life0, 'async_trait>(
&'life0 self,
oldpath: PathBuf,
newpath: PathBuf
) -> Pin<Box<dyn Future<Output = FsResult<()>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn symlink_sync(
&self,
oldpath: &Path,
newpath: &Path,
file_type: Option<FsFileType>
) -> FsResult<()>;
fn symlink_async<'life0, 'async_trait>(
&'life0 self,
oldpath: PathBuf,
newpath: PathBuf,
file_type: Option<FsFileType>
) -> Pin<Box<dyn Future<Output = FsResult<()>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn read_link_sync(&self, path: &Path) -> FsResult<PathBuf>;
fn read_link_async<'life0, 'async_trait>(
&'life0 self,
path: PathBuf
) -> Pin<Box<dyn Future<Output = FsResult<PathBuf>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn truncate_sync(&self, path: &Path, len: u64) -> FsResult<()>;
fn truncate_async<'life0, 'async_trait>(
&'life0 self,
path: PathBuf,
len: u64
) -> Pin<Box<dyn Future<Output = FsResult<()>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn utime_sync(
&self,
path: &Path,
atime_secs: i64,
atime_nanos: u32,
mtime_secs: i64,
mtime_nanos: u32
) -> FsResult<()>;
fn utime_async<'life0, 'async_trait>(
&'life0 self,
path: PathBuf,
atime_secs: i64,
atime_nanos: u32,
mtime_secs: i64,
mtime_nanos: u32
) -> Pin<Box<dyn Future<Output = FsResult<()>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn write_file_sync(
&self,
path: &Path,
options: OpenOptions,
data: &[u8]
) -> FsResult<()> { ... }
fn write_file_async<'life0, 'async_trait>(
&'life0 self,
path: PathBuf,
options: OpenOptions,
data: Vec<u8>
) -> Pin<Box<dyn Future<Output = FsResult<()>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn read_file_sync(&self, path: &Path) -> FsResult<Vec<u8>> { ... }
fn read_file_async<'life0, 'async_trait>(
&'life0 self,
path: PathBuf
) -> Pin<Box<dyn Future<Output = FsResult<Vec<u8>>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn is_file(&self, path: &Path) -> bool { ... }
fn is_dir(&self, path: &Path) -> bool { ... }
fn exists(&self, path: &Path) -> bool { ... }
fn read_to_string(&self, path: &Path) -> FsResult<String> { ... }
}