Skip to content
masterclass Buddy

Rust · Class

Mutex

Mutex<T> protects shared data by allowing one thread to access it at a time. Its guard releases the lock automatically when it is dropped.

Last updated

Since
1.0.0

Syntax

pub struct Mutex<T: ?Sized> { /* private fields */ }

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • MutexGuard
  • LockResult
  • PoisonError
  • Arc
  • try_lock
  • lock
  • clear_poison

Source: Mutex in std::sync - Rust. Checked 2026-11-03.