deferred-box

Crates.iodeferred-box
lib.rsdeferred-box
version0.1.4
sourcesrc
created_at2024-11-03 07:05:56.234208
updated_at2024-11-03 07:51:26.012703
descriptionDefer the value set after the struct has been initialized
homepage
repositoryhttps://github.com/victorteokw/deferred-box
max_upload_size
id1433433
size4,797
Victor Teo (victorteokw)

documentation

README

Deferred Box

Defer the value set after the struct has been initialized.

Installation

Add these lines to Cargo.toml under the [dependencies] section:

deferred-box = "0.1"

Usage

let deferred_box = DeferredBox::new();
deferred_box.get(); // None
deferred_box.set(42);
deferred_box.get(); // Some(&42)
deferred_box.get_or_init(|| 0); // &42

License

MIT License

Commit count: 7

cargo fmt