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