From df1ca4a158eda08846e11ceb03dd68d6fcffda75 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Mon, 8 May 2023 11:02:02 -0400 Subject: 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. --- ext/fs/interface.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'ext/fs/interface.rs') 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; + #[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; fn tmp_dir(&self) -> FsResult; fn chdir(&self, path: &Path) -> FsResult<()>; -- cgit v1.2.3