1use std::{future::Future, pin::Pin};
7
8#[cfg(any(not(target_family = "wasm"), feature = "napi-send-contract"))]
9pub type IcechunkBoxFuture<'a, T> = Pin<Box<dyn Future<Output = T> + Send + 'a>>;
10
11#[cfg(all(target_family = "wasm", not(feature = "napi-send-contract")))]
12pub type IcechunkBoxFuture<'a, T> = Pin<Box<dyn Future<Output = T> + 'a>>;
13
14#[cfg(any(not(target_family = "wasm"), feature = "napi-send-contract"))]
15macro_rules! ic_boxed {
16 ($fut:expr) => {
17 futures::FutureExt::boxed($fut)
18 };
19}
20
21#[cfg(all(target_family = "wasm", not(feature = "napi-send-contract")))]
22macro_rules! ic_boxed {
23 ($fut:expr) => {
24 futures::FutureExt::boxed_local($fut)
25 };
26}
27
28pub(crate) use ic_boxed;