Expand description

This crate provides a LazyCell struct which acts as a lazily filled Cell.

With a RefCell, the inner contents cannot be borrowed for the lifetime of the entire object, but only of the borrows returned. A LazyCell is a variation on RefCell which allows borrows to be tied to the lifetime of the outer object.

AtomicLazyCell is a variant that uses an atomic variable to manage coordination in a thread-safe fashion. The limitation of an AtomicLazyCell is that after it is initialized, it can’t be modified.


A lazily filled and thread-safe Cell, with frozen contents.

A lazily filled Cell, with mutable contents.