Struct std::cell::Cell
[−]
[src]
pub struct Cell<T> { value: UnsafeCell<T>, }
A mutable memory location that admits only Copy
data.
See the module-level documentation for more.
Fields
value |
Methods
impl<T> Cell<T> where T: Copy
const fn new(value: T) -> Cell<T>
fn get(&self) -> T
Returns a copy of the contained value.
Examples
use std::cell::Cell; let c = Cell::new(5); let five = c.get();
fn set(&self, value: T)
unsafe fn as_unsafe_cell(&self) -> &UnsafeCell<T>
Unstable (
as_unsafe_cell
)