Struct thunk::sync::AtomicThunk
[−]
[src]
pub struct AtomicThunk<'a, T: 'a> { /* fields omitted */ }
A thread-safe AtomicThunk
, representing a lazily computed value.
TODO: Test Option<UnsafeCell<Cache<T>>>
instead of storing thunk
invalidation in the atomic flag
.
Trait Implementations
impl<'a, T: Send + 'a> Send for AtomicThunk<'a, T>
[src]
impl<'a, T: Sync + 'a> Sync for AtomicThunk<'a, T>
[src]
impl<'a, T: 'a> Drop for AtomicThunk<'a, T>
[src]
impl<'a, T: 'a> AsRef<T> for AtomicThunk<'a, T>
[src]
fn as_ref(&self) -> &T
Performs the conversion.
impl<'a, T: 'a> AsMut<T> for AtomicThunk<'a, T>
[src]
fn as_mut(&mut self) -> &mut T
Performs the conversion.
impl<'a, T: 'a> Deref for AtomicThunk<'a, T>
[src]
type Target = T
The resulting type after dereferencing
fn deref(&self) -> &T
The method called to dereference a value
impl<'a, T: 'a> DerefMut for AtomicThunk<'a, T>
[src]
fn deref_mut(&mut self) -> &mut T
The method called to mutably dereference a value
impl<'a, T: 'a> From<T> for AtomicThunk<'a, T>
[src]
fn from(t: T) -> AtomicThunk<'a, T>
Performs the conversion.
impl<'a, T: 'a> LazyRef<'a> for AtomicThunk<'a, T>
[src]
fn defer<F: FnBox() -> T + 'a>(f: F) -> AtomicThunk<'a, T>
Defer a computation stored as a FnOnce
closure. Unwrapping/dereferencing will force the computation of the closure. Read more
fn force(&self)
Manually force a thunk's computation.
fn computed(t: Self::Target) -> Self
Construct a thunk with a precomputed value. This means unwrapping/dereferencing is effectively a no-op. Read more
impl<'a, T: 'a> LazyMut<'a> for AtomicThunk<'a, T>
[src]
impl<'a, T: 'a> Lazy<'a> for AtomicThunk<'a, T>
[src]
fn unwrap(self) -> T
Unwrap a thunk into its inner value. This forces the thunk.