pub trait Producer<T> {
// Required method
fn initialize(self) -> T;
}Expand description
For use with LazyLock.
This trait is implemented for FnOnce closures, so most users can just use
that directly. However in case they need to name a type in the LazyLock,
they can create a type that implements this trait instead.
Required Methods§
fn initialize(self) -> T
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".