Struct cell_rc::CellWrapper
[−]
[src]
pub struct CellWrapper<T> { /* fields omitted */ }
Wraps a value with a Cell
and provides the get()
method if
T
is CellCloneSafe
.
Methods
impl<T> CellWrapper<T>
[src]
fn new(value: T) -> Self
Creates a new CellWrapper
that wraps the given value.
fn into_inner(self) -> T
Consumes the CellWrapper
and returns the wrapped value.
fn as_ptr(&self) -> *mut T
Returns a raw pointer to the wrapped value.
fn set(&self, value: T)
Sets the wrapped value to a new one, destroying the old one.
fn replace(&self, value: T) -> T
Sets the wrapped value to a new one and returns the old one.
impl<T: CellCloneSafe> CellWrapper<T>
[src]
fn get(&self) -> T
Returns a clone of the wrapped value
Trait Implementations
impl<T> From<T> for CellWrapper<T>
[src]
fn from(value: T) -> Self
Performs the conversion.
impl<T: CellCloneSafe> Clone for CellWrapper<T>
[src]
fn clone(&self) -> Self
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more