Trait Producer

Source
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§

Source

fn initialize(self) -> T

Implementors§

Source§

impl<F, T> Producer<T> for F
where F: FnOnce() -> T,