std-macro-extensions 1.0.1

A collection of macro extensions for Rust's standard library data structures, simplifying the creation and manipulation of common collections such as HashMap, Vec, and more.
Documentation
1
2
3
4
5
6
7
8
9
10
/// Creates a new `Mutex` instance.
///
/// This macro takes a value and wraps it in a `Mutex`, providing thread-safe interior mutability.
/// The `Mutex` type ensures mutual exclusion, allowing only one thread to access the value at a time.
#[macro_export]
macro_rules! mutex {
    ($val:expr) => {
        std::sync::Mutex::new($val)
    };
}