Rust Search

Find the best content on Rust, curated by the community; a search engine for Rustaceans.
doc.rust-lang.org
pub const fn get_or_insert_default(&mut self) -> &mut T
Inserts the default value into the option if it is None, then returns a mutable reference to the contained value.
method core Stable since 1.83.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn get_or_insert(&mut self, value: T) -> &mut T
Inserts value into the option if it is None, then returns a mutable reference to the contained value.
method core Stable since 1.20.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn flatten(self) -> Option<T>
Converts from Option<Option<T>> to Option<T>.
method core Stable since 1.40.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn filter<P>(self, predicate: P) -> Self
Returns None if the option is None, otherwise calls predicate with the wrapped value and returns:
method core Stable since 1.27.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn expect(self, msg: &str) -> T
Returns the contained Some value, consuming the self value.
method core Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn copied(self) -> Option<T>
Maps an Option<&T> to an Option<T> by copying the contents of the option.
method core Stable since 1.35.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn cloned(self) -> Option<T>
Maps an Option<&T> to an Option<T> by cloning the contents of the option.
method core Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn as_slice(&self) -> &[T]
Returns a slice of the contained value, if any. If this is None, an empty slice is returned. This can be useful to have a single type of iterator over an Option or slice.
method core Stable since 1.75.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn as_ref(&self) -> Option<&T>
Converts from &Option<T> to Option<&T>.
method core Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn as_pin_ref(self: Pin<&Self>) -> Option<Pin<&T>>
Converts from Pin<shared reference&Option<T>> to Option<Pin<shared reference&T>>.
method core Stable since 1.33.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn as_pin_mut(self: Pin<&mut Self>) -> Option<Pin<&mut T>>
Converts from Pin<mutable reference&mut Option<T>> to Option<Pin<mutable reference&mut T>>.
method core Stable since 1.33.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice of the contained value, if any. If this is None, an empty slice is returned. This can be useful to have a single type of iterator over an Option or slice.
method core Stable since 1.75.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn as_mut(&mut self) -> Option<&mut T>
Converts from &mut Option<T> to Option<&mut T>.
method core Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn as_deref_mut(&mut self) -> Option<&mut <T as >::Target>
Converts from Option<T> (or &mut Option<T>) to Option<&mut T::Target>.
method core Stable since 1.40.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn as_deref(&self) -> Option<&<T as >::Target>
Converts from Option<T> (or &Option<T>) to Option<&T::Target>.
method core Stable since 1.40.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn and_then<U, F>(self, f: F) -> Option<U>
Returns None if the option is None, otherwise calls f with the wrapped value and returns the result.
method core Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn and<U>(self, optb: Option<U>) -> Option<U>
Returns None if the option is None, otherwise returns optb.
method core Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub enum Option<T>
The Option type. See the module level documentation for more.
enum core Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub struct IterMut<'a, A>
An iterator over a mutable reference to the Some variant of an Option.
struct core Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub struct Iter<'a, A>
An iterator over a reference to the Some variant of an Option.
struct core Stable since 1.0.0 Version 1.100.0-nightly
"There's a lot of weird debate about whether Rust in the kernel is useful or not... in my experience, it's way more useful than I could've ever imagine..."

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.