2025-01-01 04:12:39 +09:00
|
|
|
// Copyright 2018-2025 the Deno authors. MIT license.
|
2023-05-08 11:02:02 -04:00
|
|
|
|
|
|
|
pub use inner::*;
|
|
|
|
|
|
|
|
#[cfg(feature = "sync_fs")]
|
|
|
|
mod inner {
|
|
|
|
#![allow(clippy::disallowed_types)]
|
2023-07-25 23:43:00 +02:00
|
|
|
|
2023-05-08 11:02:02 -04:00
|
|
|
pub use core::marker::Send as MaybeSend;
|
|
|
|
pub use core::marker::Sync as MaybeSync;
|
2024-12-31 12:13:39 -05:00
|
|
|
pub use std::sync::Arc as MaybeArc;
|
2023-05-08 11:02:02 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(not(feature = "sync_fs"))]
|
|
|
|
mod inner {
|
|
|
|
pub use std::rc::Rc as MaybeArc;
|
|
|
|
|
|
|
|
pub trait MaybeSync {}
|
|
|
|
impl<T> MaybeSync for T where T: ?Sized {}
|
|
|
|
pub trait MaybeSend {}
|
|
|
|
impl<T> MaybeSend for T where T: ?Sized {}
|
|
|
|
}
|
2024-12-30 12:38:20 -05:00
|
|
|
|
|
|
|
#[allow(clippy::disallowed_types)]
|
|
|
|
#[inline]
|
|
|
|
pub fn new_rc<T>(value: T) -> MaybeArc<T> {
|
|
|
|
MaybeArc::new(value)
|
|
|
|
}
|