const
values are always inlined and have no address in memory.static
values are never inlined and have one instance with a fixed address.static mut
values are not memory safe and thus can only be accessed in an unsafe
block.lazy_static
objects are immutable, are initialized only once, are shared among all threads, and can be directly accessed (there are no wrapper types involved). In contrast, thread_local
objects are meant to be mutable, are initialized once for each thread, and accesses are indirect (involving the wrapper type LocalKey<T>
)