diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2023-05-08 11:02:02 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-08 11:02:02 -0400 |
commit | df1ca4a158eda08846e11ceb03dd68d6fcffda75 (patch) | |
tree | a2c3f2922a3b6326d223e079e3acbedb95048918 /ext/fs/interface.rs | |
parent | 0aa2d7c9c16c514e47bbd07ca90552f9159901ef (diff) |
refactor(ext/fs): `deno_fs::FileSystem` - conditional `Send + Sync` (#18993)
This allows for having a conditional `Send + Sync` on the file system trait for Deploy.
Diffstat (limited to 'ext/fs/interface.rs')
-rw-r--r-- | ext/fs/interface.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/fs/interface.rs b/ext/fs/interface.rs index 474089153..2d9b68f55 100644 --- a/ext/fs/interface.rs +++ b/ext/fs/interface.rs @@ -11,6 +11,9 @@ use deno_io::fs::File; use deno_io::fs::FsResult; use deno_io::fs::FsStat; +use crate::sync::MaybeSend; +use crate::sync::MaybeSync; + #[derive(Deserialize, Default, Debug, Clone, Copy)] #[serde(rename_all = "camelCase")] #[serde(default)] @@ -72,8 +75,11 @@ pub struct FsDirEntry { pub is_symlink: bool, } +#[allow(clippy::disallowed_types)] +pub type FileSystemRc = crate::sync::MaybeArc<dyn FileSystem>; + #[async_trait::async_trait(?Send)] -pub trait FileSystem: std::fmt::Debug + Send + Sync { +pub trait FileSystem: std::fmt::Debug + MaybeSend + MaybeSync { fn cwd(&self) -> FsResult<PathBuf>; fn tmp_dir(&self) -> FsResult<PathBuf>; fn chdir(&self, path: &Path) -> FsResult<()>; |