Trait deno_fs::FileSystem

source ·
pub trait FileSystem: Debug + MaybeSend + MaybeSync {
Show 47 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, access_check: Option<AccessCheckCb<'_>> ) -> FsResult<Rc<dyn File>>; fn open_async<'a, 'async_trait>( &'a self, path: PathBuf, options: OpenOptions, access_check: Option<AccessCheckCb<'a>> ) -> Pin<Box<dyn Future<Output = FsResult<Rc<dyn File>>> + 'async_trait>> where Self: 'async_trait, 'a: '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 cp_sync(&self, path: &Path, new_path: &Path) -> FsResult<()>; fn cp_async<'life0, 'async_trait>( &'life0 self, path: PathBuf, new_path: 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, access_check: Option<AccessCheckCb<'_>>, data: &[u8] ) -> FsResult<()> { ... } fn write_file_async<'a, 'async_trait>( &'a self, path: PathBuf, options: OpenOptions, access_check: Option<AccessCheckCb<'a>>, data: Vec<u8> ) -> Pin<Box<dyn Future<Output = FsResult<()>> + 'async_trait>> where Self: 'async_trait, 'a: 'async_trait { ... } fn read_file_sync( &self, path: &Path, access_check: Option<AccessCheckCb<'_>> ) -> FsResult<Vec<u8>> { ... } fn read_file_async<'a, 'async_trait>( &'a self, path: PathBuf, access_check: Option<AccessCheckCb<'a>> ) -> Pin<Box<dyn Future<Output = FsResult<Vec<u8>>> + 'async_trait>> where Self: 'async_trait, 'a: 'async_trait { ... } fn is_file_sync(&self, path: &Path) -> bool { ... } fn is_dir_sync(&self, path: &Path) -> bool { ... } fn exists_sync(&self, path: &Path) -> bool { ... } fn read_text_file_sync( &self, path: &Path, access_check: Option<AccessCheckCb<'_>> ) -> FsResult<String> { ... } fn read_text_file_async<'a, 'async_trait>( &'a self, path: PathBuf, access_check: Option<AccessCheckCb<'a>> ) -> Pin<Box<dyn Future<Output = FsResult<String>> + 'async_trait>> where Self: 'async_trait, 'a: 'async_trait { ... }
}

Required Methods§

source

fn cwd(&self) -> FsResult<PathBuf>

source

fn tmp_dir(&self) -> FsResult<PathBuf>

source

fn chdir(&self, path: &Path) -> FsResult<()>

source

fn umask(&self, mask: Option<u32>) -> FsResult<u32>

source

fn open_sync( &self, path: &Path, options: OpenOptions, access_check: Option<AccessCheckCb<'_>> ) -> FsResult<Rc<dyn File>>

source

fn open_async<'a, 'async_trait>( &'a self, path: PathBuf, options: OpenOptions, access_check: Option<AccessCheckCb<'a>> ) -> Pin<Box<dyn Future<Output = FsResult<Rc<dyn File>>> + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait,

source

fn mkdir_sync(&self, path: &Path, recursive: bool, mode: u32) -> FsResult<()>

source

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,

source

fn chmod_sync(&self, path: &Path, mode: u32) -> FsResult<()>

source

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,

source

fn chown_sync( &self, path: &Path, uid: Option<u32>, gid: Option<u32> ) -> FsResult<()>

source

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,

source

fn remove_sync(&self, path: &Path, recursive: bool) -> FsResult<()>

source

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,

source

fn copy_file_sync(&self, oldpath: &Path, newpath: &Path) -> FsResult<()>

source

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,

source

fn cp_sync(&self, path: &Path, new_path: &Path) -> FsResult<()>

source

fn cp_async<'life0, 'async_trait>( &'life0 self, path: PathBuf, new_path: PathBuf ) -> Pin<Box<dyn Future<Output = FsResult<()>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source

fn stat_sync(&self, path: &Path) -> FsResult<FsStat>

source

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,

source

fn lstat_sync(&self, path: &Path) -> FsResult<FsStat>

source

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,

source

fn realpath_sync(&self, path: &Path) -> FsResult<PathBuf>

source

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,

source

fn read_dir_sync(&self, path: &Path) -> FsResult<Vec<FsDirEntry>>

source

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,

source

fn rename_sync(&self, oldpath: &Path, newpath: &Path) -> FsResult<()>

source

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,

source

fn truncate_sync(&self, path: &Path, len: u64) -> FsResult<()>

source

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,

source

fn utime_sync( &self, path: &Path, atime_secs: i64, atime_nanos: u32, mtime_secs: i64, mtime_nanos: u32 ) -> FsResult<()>

source

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§

source

fn write_file_sync( &self, path: &Path, options: OpenOptions, access_check: Option<AccessCheckCb<'_>>, data: &[u8] ) -> FsResult<()>

source

fn write_file_async<'a, 'async_trait>( &'a self, path: PathBuf, options: OpenOptions, access_check: Option<AccessCheckCb<'a>>, data: Vec<u8> ) -> Pin<Box<dyn Future<Output = FsResult<()>> + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait,

source

fn read_file_sync( &self, path: &Path, access_check: Option<AccessCheckCb<'_>> ) -> FsResult<Vec<u8>>

source

fn read_file_async<'a, 'async_trait>( &'a self, path: PathBuf, access_check: Option<AccessCheckCb<'a>> ) -> Pin<Box<dyn Future<Output = FsResult<Vec<u8>>> + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait,

source

fn is_file_sync(&self, path: &Path) -> bool

source

fn is_dir_sync(&self, path: &Path) -> bool

source

fn exists_sync(&self, path: &Path) -> bool

source

fn read_text_file_sync( &self, path: &Path, access_check: Option<AccessCheckCb<'_>> ) -> FsResult<String>

source

fn read_text_file_async<'a, 'async_trait>( &'a self, path: PathBuf, access_check: Option<AccessCheckCb<'a>> ) -> Pin<Box<dyn Future<Output = FsResult<String>> + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait,

Implementors§