TempRef
overview
This crate provides a type whose value remains unchanged even when accessed through a mutable reference.
features
- Automatically reset when the mutable reference is dropped
- Works in both single-threaded and multi-threaded contexts
- no_std compatible (only the unsync module)
feature flags
| Module | Characteristics | Feature Flags |
|---|---|---|
unsync |
!Sync, !Send type supports no_std |
default, all, no_std, unsync |
mutex |
Sync, Send type using std::sync::Mutex |
default, all, mutex |
rwlock |
Sync, Send type using std::sync::RwLock |
default, all, rwlock |
usage
use Temp;
let data = vec!;
let workspace = new;
assert_eq!;
// d.fill(0) is called here.
assert_eq!;