Trait vasi_sync::lazy_lock::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,