A mutable, nullable memory location

Struct Cell

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

Implementation of ::std::clone::Clone for Cell<T> where <T: ::std::clone::Clone>

Automatically derived.

Method clone

fn clone(&self) -> Cell<T>

Implementation of ::std::clone::DeepClone for Cell<T> where <T: ::std::clone::DeepClone>

Automatically derived.

Method deep_clone

fn deep_clone(&self) -> Cell<T>

Implementation of ::std::cmp::Eq for Cell<T> where <T: ::std::cmp::Eq>

Automatically derived.

Method eq

fn eq(&self, __arg_0: &Cell<T>) -> ::bool

Method ne

fn ne(&self, __arg_0: &Cell<T>) -> ::bool

Implementation for Cell<T> where <T>

Method new

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

Creates a new full cell with the given value.

Method new_empty

fn new_empty() -> Cell<T>

Creates a new empty cell with no value inside.

Method take

fn take(&self) -> T

Yields the value, failing if the cell is empty.

Method put_back

fn put_back(&self, value: T)

Returns the value, failing if the cell is full.

Method is_empty

fn is_empty(&self) -> bool

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

Method with_ref

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

Calls a closure with a reference to the value.

Method with_mut_ref

fn with_mut_ref<R>(&self, op: &fn(v: &mut T) -> R) -> R

Calls a closure with a mutable reference to the value.