use std::fmt; use dyn_clone::DynClone; use yazi_macro::impl_data_any; use crate::input::InputEvent; pub trait InputCallback: Fn(InputEvent) + Send + Sync + DynClone + 'static {} impl InputCallback for T {} impl Clone for Box { fn clone(&self) -> Self { dyn_clone::clone_box(&**self) } } impl fmt::Debug for dyn InputCallback { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("InputCallback").finish_non_exhaustive() } } impl_data_any!(Box);