mod ctx; mod manager; mod rsc; pub use ctx::*; pub use manager::*; pub use rsc::*; pub trait Event: Sized + 'static + Clone { type Data<'a> = (); type State: Default = (); #[allow(unused_variables)] fn should_run(&self, data: &mut Self::Data<'_>) -> bool { true } } pub trait EventLike { type Event: Event; fn into_event(self) -> Self::Event; } impl EventLike for E { type Event = Self; fn into_event(self) -> Self::Event { self } } pub trait EventFn: Fn(&mut EventCtx, &mut Rsc) + 'static {} impl, &mut Rsc) + 'static, Data> EventFn for F { } pub trait WidgetEventFn: Fn(&mut EventIdCtx, &mut Rsc) + 'static { } impl, &mut Rsc) + 'static, Data, W: ?Sized> WidgetEventFn for F { }