Struct Cell

pub struct Cell <T>{
        mut value: Option<T>,
    }

A dynamic, mutable location.

Implementation for Cell<T>

Method take

fn take() -> T

Yields the value, failing if the cell is empty.

Method put_back

fn put_back(value: T)

Returns the value, failing if the cell is full.

Method is_empty

fn is_empty() -> bool

Returns true if the cell is empty and false if the cell is full.

Method with_ref

fn with_ref<R>(op: fn&(v: & T) -> R) -> R

Function Cell

fn Cell<T>(value: T) -> Cell<T>

Creates a new full cell with the given value.

Function empty_cell

fn empty_cell<T>() -> Cell<T>