A mutable, nullable memory location
Cell
of ::std::clone::Clone for Cell<T> where <T: ::std::clone::Clone>
- Automatically derived.of ::std::clone::DeepClone for Cell<T> where <T: ::std::clone::DeepClone>
- Automatically derived.of ::std::cmp::Eq for Cell<T> where <T: ::std::cmp::Eq>
- Automatically derived.for Cell<T> where <T>
Cell
pub struct Cell<T> {
priv value: Option<T>,
}
::std::clone::Clone
for Cell<T>
where <T: ::std::clone::Clone>
Automatically derived.
clone
fn clone(&self) -> Cell<T>
::std::clone::DeepClone
for Cell<T>
where <T: ::std::clone::DeepClone>
Automatically derived.
deep_clone
fn deep_clone(&self) -> Cell<T>
::std::cmp::Eq
for Cell<T>
where <T: ::std::cmp::Eq>
Automatically derived.
eq
fn eq(&self, __arg_0: &Cell<T>) -> ::bool
ne
fn ne(&self, __arg_0: &Cell<T>) -> ::bool
Cell<T>
where <T>
new
fn new(value: T) -> Cell<T>
Creates a new full cell with the given value.
new_empty
fn new_empty() -> Cell<T>
Creates a new empty cell with no value inside.
take
fn take(&self) -> T
Yields the value, failing if the cell is empty.
put_back
fn put_back(&self, value: T)
Returns the value, failing if the cell is full.
is_empty
fn is_empty(&self) -> bool
Returns true if the cell is empty and false if the cell is full.
with_ref
fn with_ref<R>(&self, op: &fn(v: &T) -> R) -> R
Calls a closure with a reference to the value.
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.