Rust Search

Find the best content on Rust, curated by the community; a search engine for Rustaceans.
doc.rust-lang.org
pub fn filter_map<U, F>(orig: RefMut<'b, T>, f: F) -> Result<RefMut<'b, U>, Self>
Makes a new RefMut 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 struct RefMut<'b, T>
A wrapper type for a mutably borrowed value from a RefCell<T>.
struct core Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn try_borrow_unguarded(&self) -> Result<&T, BorrowError>
Immutably borrows the wrapped value, returning an error if the value is currently mutably borrowed.
method core Stable since 1.37.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn try_borrow_mut(&self) -> Result<RefMut<'_, T>, BorrowMutError>
Mutably borrows the wrapped value, returning an error if the value is currently borrowed.
method core Stable since 1.13.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn try_borrow(&self) -> Result<Ref<'_, T>, BorrowError>
Immutably borrows the wrapped value, returning an error if the value is currently mutably borrowed.
method core Stable since 1.13.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn take(&self) -> T
Takes the wrapped value, leaving Default::default() in its place.
method core Stable since 1.50.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn swap(&self, other: &Self)
Swaps the wrapped value of self with the wrapped value of other, without deinitializing either one.
method core Stable since 1.24.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn replace_with<F>(&self, f: F) -> T
Replaces the wrapped value with a new one computed from f, returning the old value, without deinitializing either one.
method core Stable since 1.35.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
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 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 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 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 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 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 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 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 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 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 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
"**Rust** : You can't move your object and try to keep it, too. **Me** : Ok, I suppose I can clone it? **Rust** : Then implement a clone method. **Me**..."

Search tips

Type anything to search across articles, videos (including conference talks), podcasts, research, crates, and Rust API documentation. These operators give you finer control — click an example to try it.

Find pages containing all your words. Pages where the words appear together rank higher.
Quote part of your query to keep those words together as an exact phrase within a larger search.
Wrap the whole query in quotes for a verbatim search that matches text exactly, punctuation and all — perfect for Rust syntax. Needs at least 3 characters.
Put ! first to open the top result immediately. Quote the whole query for a literal leading bang, as in '!Send'. Bangs elsewhere, such as println!, stay literal. Browser and launcher shortcuts can invoke this directly. See search integrations.
Limit results to a single site. Works on its own () too. One site: per search.

Use the tabs and filters above the results to narrow by content type, publication year, and sort order.