Crate thunk [] [src]

This crate provides functionality for thread-safe and non-thread-safe lazy evaluation in Rust. It also provides functionality for generically working with thunks of a given type.

Three different thunk types are provided, all implementing Lazy: * unsync::Thunk: a non thread-safe thunk. * sync::Thunk: a thread-safe thunk, which implements Send + Sync. * strict::Thunk: a strict, non-deferred thunk which always immediately evaluates whatever computation it's given, intended for genericity over strictness.

Reexports

pub use strict::Strict;
pub use sync::AtomicThunk;
pub use unsync::Thunk;

Modules

strict
sync
unsync

Traits

Lazy

The Lazy trait abstracts lazily computed values, also known as "thunks".