separate state from rsc
This commit is contained in:
@@ -28,14 +28,17 @@ impl<E: Event> EventLike for E {
|
||||
}
|
||||
}
|
||||
|
||||
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 EventFn<Rsc: HasEvents, Data>: Fn(&mut EventCtx<Rsc, Data>, &mut Rsc) + 'static {}
|
||||
impl<Rsc: HasEvents, F: Fn(&mut EventCtx<Rsc, Data>, &mut Rsc) + 'static, Data> EventFn<Rsc, Data>
|
||||
for F
|
||||
{
|
||||
}
|
||||
|
||||
pub trait WidgetEventFn<State, Data, W: ?Sized>:
|
||||
Fn(&mut EventIdCtx<State, Data, W>) + 'static
|
||||
pub trait WidgetEventFn<Rsc: HasEvents, Data, W: ?Sized>:
|
||||
Fn(&mut EventIdCtx<Rsc, Data, W>, &mut Rsc) + 'static
|
||||
{
|
||||
}
|
||||
impl<State, F: Fn(&mut EventIdCtx<State, Data, W>) + 'static, Data, W: ?Sized>
|
||||
WidgetEventFn<State, Data, W> for F
|
||||
impl<Rsc: HasEvents, F: Fn(&mut EventIdCtx<Rsc, Data, W>, &mut Rsc) + 'static, Data, W: ?Sized>
|
||||
WidgetEventFn<Rsc, Data, W> for F
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user