better global state structure?
This commit is contained in:
@@ -28,11 +28,14 @@ impl<E: Event> EventLike for E {
|
||||
}
|
||||
}
|
||||
|
||||
pub trait EventFn<State, Data>: Fn(EventCtx<State, Data>) + 'static {}
|
||||
impl<State, F: Fn(EventCtx<State, Data>) + 'static, Data> EventFn<State, Data> for F {}
|
||||
pub trait EventFn<State, Data>: Fn(&mut EventCtx<State, Data>) + 'static {}
|
||||
impl<State, F: Fn(&mut EventCtx<State, Data>) + 'static, Data> EventFn<State, Data> for F {}
|
||||
|
||||
pub trait WidgetEventFn<State, Data, W: ?Sized>: Fn(EventIdCtx<State, Data, W>) + 'static {}
|
||||
impl<State, F: Fn(EventIdCtx<State, Data, W>) + 'static, Data, W: ?Sized>
|
||||
pub trait WidgetEventFn<State, Data, W: ?Sized>:
|
||||
Fn(&mut EventIdCtx<State, Data, W>) + 'static
|
||||
{
|
||||
}
|
||||
impl<State, F: Fn(&mut EventIdCtx<State, Data, W>) + 'static, Data, W: ?Sized>
|
||||
WidgetEventFn<State, Data, W> for F
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user