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/lib.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/lib.rs')
-rw-r--r-- | ext/fs/lib.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ext/fs/lib.rs b/ext/fs/lib.rs index 4fdf6b3f1..fb0a6ffed 100644 --- a/ext/fs/lib.rs +++ b/ext/fs/lib.rs @@ -3,14 +3,18 @@ mod interface; mod ops; mod std_fs; +pub mod sync; pub use crate::interface::FileSystem; +pub use crate::interface::FileSystemRc; pub use crate::interface::FsDirEntry; pub use crate::interface::FsFileType; pub use crate::interface::OpenOptions; -use crate::ops::*; - pub use crate::std_fs::RealFs; +pub use crate::sync::MaybeSend; +pub use crate::sync::MaybeSync; + +use crate::ops::*; use deno_core::error::AnyError; use deno_core::OpState; @@ -18,7 +22,6 @@ use std::cell::RefCell; use std::convert::From; use std::path::Path; use std::rc::Rc; -use std::sync::Arc; pub trait FsPermissions { fn check_read(&mut self, p: &Path, api_name: &str) -> Result<(), AnyError>; @@ -153,7 +156,7 @@ deno_core::extension!(deno_fs, esm = [ "30_fs.js" ], options = { unstable: bool, - fs: Arc<dyn FileSystem>, + fs: FileSystemRc, }, state = |state, options| { state.put(UnstableChecker { unstable: options.unstable }); |