`self` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement

When the compiler says it wants 'static, it's very poorly trying to say that all temporary references are forbidden (@ekuber any chance of removing misleading 'static from errors?)

No amount of lifetime annotations can solve this problem. You can't take a temporarily borrowed argument of a function and pass it to a thread that may live for as long as it wants (which event_loop.run most likely wants to do).

If you can, you need to change the temporary scope-bound &self to an owned self that can be moved to the event loop. Alternatively, if you need to use it in multiple places, try Arc<Self> or reorganize the code in a way that the even loop doesn't use self.

Generally, when compiler demands 'static, ignore it, and keep wrapping stuff in Arc or Arc<Mutex> until it compiles. Don't use references.

If you have only one instance of Application, then the last-resort hack is to use Box::leak to make a leaked reference, which actually is 'static like the compiler wanted.