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 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 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 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 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 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 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 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 clone(orig: &Ref<'b, T>) -> Ref<'b, T>
Copies a Ref.
associated_function
core
Stable since 1.15.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn filter_map<U, F>(orig: Ref<'b, T>, f: F) -> Result<Ref<'b, U>, Self>
Makes a new Ref for an optional component of the borrowed data. The original guard is returned as an Err(..) if the closure returns None.
associated_function
core
Stable since 1.63.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn map<U, F>(orig: Ref<'b, T>, f: F) -> Ref<'b, U>
Makes a new Ref for a component of the borrowed data.
associated_function
core
Stable since 1.8.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn map_split<U, V, F>(orig: Ref<'b, T>, f: F) -> (Ref<'b, U>, Ref<'b, V>)
Splits a Ref into multiple Refs for different components of the borrowed data.
associated_function
core
Stable since 1.35.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct RefCell<T>
A mutable memory location with dynamically checked borrow rules
struct
core
Stable since 1.0.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 borrow(&self) -> Ref<'_, T>
Immutably borrows the wrapped value.
method
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn borrow_mut(&self) -> RefMut<'_, T>
Mutably borrows the wrapped value.
method
core
Stable since 1.0.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 into_inner(self) -> T
Consumes the RefCell, returning the wrapped value.
method
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn new(value: T) -> RefCell<T>
Creates a new RefCell containing value.
associated_function
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn replace(&self, t: T) -> T
Replaces the wrapped value with a new one, returning the old value, without deinitializing either one.
method
core
Stable since 1.24.0
Version 1.100.0-nightly