'static is a reserved lifetime name, you might have encountered it several times:
#![allow(unused)]fnmain() {
// A reference with 'static lifetime:let s: &'staticstr = "hello world";
// 'static as part of a trait bound:fngeneric<T>(x: T) where T: 'static {}
}
Though they are all 'static, but subtly different.
As a reference lifetime, &'static indicates the data pointed to by the reference lives as long as the running program. But it can still be coerced to a shorter lifetime.
🌟🌟 There are several ways to make a variable with 'static lifetime, two of them are stored in the read-only memory of the binary.
As a trait bound, it means the type does not contain any non-static references. Eg. the receiver can hold on to the type for as long as they want and it will never become invalid until they drop it.
It's important to understand this means that any owned data always passes a 'static lifetime bound, but a reference to that owned data generally does not.