use super::ContextMut;
pub trait OnAction<S, E, Ctx> {
fn call(&mut self, cx: ContextMut<S, E, Ctx>);
}
impl<S, E, Ctx, F> OnAction<S, E, Ctx> for F
where
F: FnMut(ContextMut<S, E, Ctx>),
{
fn call(&mut self, cx: ContextMut<S, E, Ctx>) {
(self)(cx)
}
}
impl<S, E, Ctx> OnAction<S, E, Ctx> for () {
fn call(&mut self, _: ContextMut<S, E, Ctx>) {}
}