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 owned thunk types are provided, implementing Lazy
,
LazyRef
, and LazyMut
:
* Thunk
: a non thread-safe thunk.
* AtomicThunk
: a thread-safe thunk, which implements Send + Sync
.
* Strict
: a strict, non-deferred thunk which always immediately
evaluates whatever computation it's given, intended for genericity over
strictness.
In addition, two shared thunk types are provided, implementing LazyRef
and LazyShared
:
* RcThunk
: a reference-counted thunk type. This is a wrapper over Thunk
.
* ArcThunk
: an atomically reference-counted thunk type. This is a wrapper
over AtomicThunk
.
Reexports
pub use strict::Strict; |
pub use sync::AtomicThunk; |
pub use sync::ArcThunk; |
pub use unsync::Thunk; |
pub use unsync::RcThunk; |
Modules
strict | |
sync | |
unsync |
Traits
Lazy |
The |
LazyMut |
The |
LazyRef |
The |