When you're storing a bunch of values in a HashMap or another collection for a while, usually you want them to be owned types like String and Box<dyn Fn()> instead of borrowed types like &'a str and &'a dyn Fn(). Making this change might fix some of the lifetime errors you're running into.
Also, instead of iterating through every entry of self.keys, you can use get() to only look up the key you need. Rust Playground:
Your example code does not reproduce this error. It doesn't compile due to some fairly trivial syntax errors (e.g. your type and variable names seem to be inconsistent, mutability is wrong, etc.). If you fix those, there are no lifetime-related errors or even warnings.