Struct lazycell::AtomicLazyCell
[−]
[src]
pub struct AtomicLazyCell<T> { /* fields omitted */ }
A lazily filled Cell
, with frozen contents.
Methods
impl<T> AtomicLazyCell<T>
[src]
impl<T> AtomicLazyCell<T>
pub fn new() -> AtomicLazyCell<T>
[src]
pub fn new() -> AtomicLazyCell<T>
Creates a new, empty, AtomicLazyCell
.
pub fn fill(&self, t: T) -> Result<(), T>
[src]
pub fn fill(&self, t: T) -> Result<(), T>
Put a value into this cell.
This function will return Err(value)
is the cell is already full.
pub fn filled(&self) -> bool
[src]
pub fn filled(&self) -> bool
Test whether this cell has been previously filled.
pub fn borrow(&self) -> Option<&T>
[src]
pub fn borrow(&self) -> Option<&T>
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]
pub fn into_inner(self) -> Option<T>
Consumes this LazyCell
, returning the underlying value.
impl<T: Copy> AtomicLazyCell<T>
[src]
impl<T: Copy> AtomicLazyCell<T>
pub fn get(&self) -> Option<T>
[src]
pub fn get(&self) -> Option<T>
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]
impl<T: Debug> Debug for AtomicLazyCell<T>
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T: Default> Default for AtomicLazyCell<T>
[src]
impl<T: Default> Default for AtomicLazyCell<T>
fn default() -> AtomicLazyCell<T>
[src]
fn default() -> AtomicLazyCell<T>
Returns the "default value" for a type. Read more
impl<T: Sync + Send> Sync for AtomicLazyCell<T>
[src]
impl<T: Sync + Send> Sync for AtomicLazyCell<T>
impl<T: Send> Send for AtomicLazyCell<T>
[src]
impl<T: Send> Send for AtomicLazyCell<T>