Trait EffectFunction

pub trait EffectFunction<T, M> {
    // Required method
    fn run(&mut self, p: Option<T>) -> T;
}
Expand description

Trait to enable effect functions that have zero or one parameter

Required Methods§

fn run(&mut self, p: Option<T>) -> T

Call this to execute the function. In case the actual function has no parameters the parameter p will simply be ignored.

Implementors§

§

impl<Func> EffectFunction<(), NoParam> for Func
where Func: FnMut(),

§

impl<Func, T> EffectFunction<T, SingleParam> for Func
where Func: FnMut(Option<T>) -> T,