Struct thunk::sync::ArcThunk [] [src]

pub struct ArcThunk<T>(_);

An Arc-wrapped AtomicThunk which implements LazyRef.

Methods

impl<T> ArcThunk<T>
[src]

If the ArcThunk is unevaluated, this will force it. If the RcThunk is the sole, unique owner of the underlying thunk, this will return the forced value; otherwise, it will return an Err containing the original ArcThunk.

If the ArcThunk is unevaluated, this will force it. If the RcThunk is the sole, unique owner of the underlying thunk, this will return a mutable reference to the forced value; otherwise, it will return None.

If the ArcThunk is unevaluated, this will force it. If the RcThunk is the sole, unique owner of the underlying thunk, this will return a mutable reference to the forced value; if it is not, then it will clone the forced value and return a mutable reference to the newly cloned value. The &mut ArcThunk passed in will be updated to reference the newly cloned value.

Trait Implementations

impl<T> Clone for ArcThunk<T>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T> AsRef<T> for ArcThunk<T>
[src]

Performs the conversion.

impl<T> Deref for ArcThunk<T>
[src]

The resulting type after dereferencing

The method called to dereference a value

impl<T> From<T> for ArcThunk<T>
[src]

Performs the conversion.

impl<T> LazyRef for ArcThunk<T>
[src]

Defer a computation stored as a FnOnce closure. Unwrapping/dereferencing will force the computation of the closure. The supplied closure must live as long as the type which the thunk computes. Read more

Manually force a thunk's computation.

Construct a thunk with a precomputed value. This means forcing the thunk is a no-op. Read more