pub enum Action { Future(iced_futures::BoxFuture), } use std::fmt; impl Action { /// Applies a transformation to the result of a [`Command`]. #[cfg(target_arch = "wasm32")] pub fn map(self, f: impl Fn(T) -> A + 'static) -> Action where T: 'static, { use iced_futures::futures::FutureExt; match self { Self::Future(future) => Action::Future(Box::pin(future.map(f))), } } } impl fmt::Debug for Action { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { Self::Future(_) => write!(f, "Action::Future"), } } }