Rust Search

Find the best content on Rust, curated by the community; a search engine for Rustaceans.
doc.rust-lang.org
pub const fn new(t: T) -> Mutex<T>
Creates a new mutex in an unlocked state ready for use.
associated_function std Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn lock(&self) -> LockResult<MutexGuard<'_, T>>
Acquires a mutex, blocking the current thread until it is able to do so.
method std Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn is_poisoned(&self) -> bool
Determines whether the mutex is poisoned.
method std Stable since 1.2.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn into_inner(self) -> LockResult<T>
Consumes this mutex, returning the underlying data.
method std Stable since 1.6.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn get_mut(&mut self) -> LockResult<&mut T>
Returns a mutable reference to the underlying data.
method std Stable since 1.6.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn clear_poison(&self)
Clear the poisoned state from a mutex.
method std Stable since 1.77.0 Version 1.100.0-nightly
doc.rust-lang.org
pub struct Mutex<T>
A mutual exclusion primitive useful for protecting shared data
struct std Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub struct Condvar
A Condition Variable
struct std Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub type TryLockResult<Guard> = Result<Guard, TryLockError<Guard>>
A type alias for the result of a nonblocking locking method.
type_alias std Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub enum TryLockError<T>
An enumeration of possible errors associated with a TryLockResult which can occur while trying to acquire a lock, from the try_lock method on a Mutex or the try_read and try_write methods on an RwLock.
enum std Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub struct PoisonError<T>
A type of error which can be returned whenever a lock is acquired.
struct std Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub type LockResult<T> = Result<T, PoisonError<T>>
A type alias for the result of a lock method which can be poisoned.
type_alias std Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn wait(&self) -> &T
Blocks the current thread until the cell is initialized.
method std Stable since 1.86.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn take(&mut self) -> Option<T>
Takes the value out of this OnceLock, moving it back to an uninitialized state.
method std Stable since 1.70.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn set(&self, value: T) -> Result<(), T>
Initializes the contents of the cell to value.
method std Stable since 1.70.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn new() -> OnceLock<T>
Creates a new uninitialized cell.
associated_function std Stable since 1.70.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn into_inner(self) -> Option<T>
Consumes the OnceLock, returning the wrapped value. Returns None if the cell was uninitialized.
method std Stable since 1.70.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn get_or_init<F>(&self, f: F) -> &T
Gets the contents of the cell, initializing it to f() if the cell was uninitialized.
method std Stable since 1.70.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn get_mut(&mut self) -> Option<&mut T>
Gets the mutable reference to the underlying value.
method std Stable since 1.70.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn get(&self) -> Option<&T>
Gets the reference to the underlying value.
method std Stable since 1.70.0 Version 1.100.0-nightly
"I love Rust like I love Dark Souls. It's difficult, but fair. I can not praise enough the software developers that realize proper errors are vastly su..."

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.