Registry / utility / mut-static

mut-static

JSON →
library5.0.0rscratesunverified

Provides a struct to help create mutable statics with lazy_static.

# Cargo.toml [dependencies] mut_static = "5.0.0"
INSTALL
IMPORT
SIG · MUT-STATIC
M
mut-static
utilityrustv5.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MutStatic
use mut_static::MutStatic;

Create and mutate a global static counter.

use mut_static::MutStatic; lazy_static! { static ref COUNTER: MutStatic<u32> = MutStatic::new(0); } fn main() { *COUNTER.lock().unwrap() += 1; println!("Count: {}", *COUNTER.lock().unwrap()); }
Debug
Known issues
gotchaRequires lazy_static crate as dependency
fix
Add lazy_static to Cargo.toml
affects: >=5.0.0
Upgrade
Version history
5.0.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
mut-static — cargo add mut-static · libregistry