Struct thunk::sync::AtomicThunk
[−]
[src]
pub struct AtomicThunk<T> { /* 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<T: Send> Send for AtomicThunk<T>
[src]
impl<T: Sync> Sync for AtomicThunk<T>
[src]
impl<T> Drop for AtomicThunk<T>
[src]
impl<T> Borrow<T> for AtomicThunk<T>
[src]
impl<T> BorrowMut<T> for AtomicThunk<T>
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> AsRef<T> for AtomicThunk<T>
[src]
fn as_ref(&self) -> &T
Performs the conversion.
impl<T> AsMut<T> for AtomicThunk<T>
[src]
fn as_mut(&mut self) -> &mut T
Performs the conversion.
impl<T> Deref for AtomicThunk<T>
[src]
type Target = T
The resulting type after dereferencing
fn deref(&self) -> &T
The method called to dereference a value
impl<T> DerefMut for AtomicThunk<T>
[src]
fn deref_mut(&mut self) -> &mut T
The method called to mutably dereference a value
impl<T> From<T> for AtomicThunk<T>
[src]
fn from(t: T) -> Self
Performs the conversion.
impl<T> LazyRef for AtomicThunk<T>
[src]
fn defer<'a, F: FnBox() -> T + 'a>(f: F) -> AtomicThunk<T> where
T: 'a,
T: 'a,
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
fn force(&self)
Manually force a thunk's computation.
fn computed(t: Self::Target) -> Self
Construct a thunk with a precomputed value. This means forcing the thunk is a no-op. Read more
impl<T> LazyMut for AtomicThunk<T>
[src]
impl<T> Lazy for AtomicThunk<T>
[src]
fn unwrap(self) -> T
Unwrap a thunk into its inner value. This forces the thunk.