doc.rust-lang.org
pub struct Ref<'b, T>
Wraps a borrowed reference to a value in a RefCell box. A wrapper type for an immutably borrowed value from a RefCell<T>.
struct
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn update(&self, f: impl ~const FnOnce(T) -> T)
Updates the contained value using a function.
method
core
Stable since 1.88.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn take(&self) -> T
Takes the value of the cell, leaving Default::default() in its place.
method
core
Stable since 1.17.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn swap(&self, other: &Self)
Swaps the values of two Cells.
method
core
Stable since 1.17.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn set(&self, val: T)
Sets the contained value.
method
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn replace(&self, val: T) -> T
Replaces the contained value with val, and returns the old contained value.
method
core
Stable since 1.17.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn new(value: T) -> Cell<T>
Creates a new Cell containing the given value.
associated_function
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn into_inner(self) -> T
Unwraps the value, consuming the cell.
method
core
Stable since 1.17.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn get_mut(&mut self) -> &mut T
Returns a mutable reference to the underlying data.
method
core
Stable since 1.11.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn get(&self) -> T
Returns a copy of the contained value.
method
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn from_mut(t: &mut T) -> &Cell<T>
Returns a &Cell<T> from a &mut T
associated_function
core
Stable since 1.37.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn as_slice_of_cells(&self) -> &[Cell<T>]
Returns a &[Cell<T>] from a &Cell<[T]>
method
core
Stable since 1.37.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn as_ptr(&self) -> *mut T
Returns a raw pointer to the underlying data in this cell.
method
core
Stable since 1.12.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn as_array_of_cells(&self) -> &[Cell<T>; N]
Returns a &[Cell<T>; N] from a &Cell<[T; N]>
method
core
Stable since 1.91.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct Cell<T>
A mutable memory location.
struct
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct BorrowMutError
An error returned by RefCell::try_borrow_mut.
struct
core
Stable since 1.13.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct BorrowError
An error returned by RefCell::try_borrow.
struct
core
Stable since 1.13.0
Version 1.100.0-nightly
doc.rust-lang.org
pub mod cell
Shareable mutable containers.
module
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
fn borrow_mut(&mut self) -> &mut Borrowed
Mutably borrows from an owned value.
method
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub trait BorrowMut<Borrowed>
A trait for mutably borrowing data.
trait
core
Stable since 1.0.0
Version 1.100.0-nightly