Struct lazycell::LazyCell
[−]
[src]
pub struct LazyCell<T> { // some fields omitted }
A lazily filled Cell, with frozen contents.
Methods
impl<T> LazyCell<T>
[src]
fn new() -> LazyCell<T>
Creates a new empty lazy cell.
fn fill(&self, t: T)
Put a value into this cell.
This function will fail if the cell has already been filled.
fn filled(&self) -> bool
Test whether this cell has been previously filled.
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.
fn into_inner(self) -> Option<T>
Consumes this LazyCell
, returning the underlying value.