Struct toolshed::cell::CopyCell
[−]
[src]
pub struct CopyCell<T: Copy> { /* fields omitted */ }
This should be identical to the Cell
implementation in the standard
library, but always require that the internal type implements Copy
and implements Copy
itself.
Methods
impl<T: Copy> CopyCell<T>
[src]
fn new(value: T) -> Self
[src]
Creates a new CopyCell
containing the given value.
fn get(&self) -> T
[src]
Returns a copy of the contained value.
fn get_mut(&mut self) -> &mut T
[src]
Returns a mutable reference to the underlying data.
This call borrows CopyCell
mutably (at compile-time) which guarantees that we possess the only reference.
fn set(&self, value: T)
[src]
Sets the contained value.
Trait Implementations
impl<T: PartialEq + Copy> PartialEq for CopyCell<T>
[src]
fn eq(&self, __arg_0: &CopyCell<T>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &CopyCell<T>) -> bool
[src]
This method tests for !=
.
impl<T: Copy + Eq> Eq for CopyCell<T>
[src]
impl<T: Copy> Clone for CopyCell<T>
[src]
fn clone(&self) -> CopyCell<T>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more