pub fn on_ok<F, T, E>(f: F) -> impl Fn(Result<T, E>)where F: Fn(T) + 'static,
Calls the input function only if the returned functions result is ok.