Cell
- A dynamic, mutable location.for Cell<T>
Cell
- Creates a new full cell with the given value.empty_cell
Cell
pub struct Cell <T>{
mut value: Option<T>,
}
A dynamic, mutable location.
Similar to a mutable option type, but friendlier.
Cell<T>
take
fn take() -> T
Yields the value, failing if the cell is empty.
put_back
fn put_back(value: T)
Returns the value, failing if the cell is full.
is_empty
fn is_empty() -> bool
Returns true if the cell is empty and false if the cell is full.
with_ref
fn with_ref<R>(op: &fn(v: &T) -> R) -> R
Cell
fn Cell<T>(value: T) -> Cell<T>
Creates a new full cell with the given value.
empty_cell
fn empty_cell<T>() -> Cell<T>