Struct lazycell::AtomicLazyCell
[−]
[src]
pub struct AtomicLazyCell<T> { /* fields omitted */ }
A lazily filled Cell
, with frozen contents.
Methods
impl<T> AtomicLazyCell<T>
[src]
pub fn new() -> AtomicLazyCell<T>
[src]
Creates a new, empty, AtomicLazyCell
.
pub fn fill(&self, t: T) -> Result<(), T>
[src]
Put a value into this cell.
This function will return Err(value)
is the cell is already full.
pub fn filled(&self) -> bool
[src]
Test whether this cell has been previously filled.
pub fn borrow(&self) -> Option<&T>
[src]
Borrows the contents of this lazy cell for the duration of the cell itself.
This function will return Some
if the cell has been previously
initialized, and None
if it has not yet been initialized.
pub fn into_inner(self) -> Option<T>
[src]
Consumes this LazyCell
, returning the underlying value.
impl<T: Copy> AtomicLazyCell<T>
[src]
pub fn get(&self) -> Option<T>
[src]
Returns a copy of the contents of the lazy cell.
This function will return Some
if the cell has been previously initialized,
and None
if it has not yet been initialized.
Trait Implementations
impl<T: Debug> Debug for AtomicLazyCell<T>
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<T: Default> Default for AtomicLazyCell<T>
[src]
fn default() -> AtomicLazyCell<T>
[src]
Returns the "default value" for a type. Read more