10 releases (2 stable)
new 1.0.1 | Mar 22, 2025 |
---|---|
1.0.0 | Mar 21, 2025 |
0.1.2 | Sep 6, 2016 |
0.1.1 | Jun 24, 2015 |
0.0.5 | Jan 21, 2015 |
#313 in Rust patterns
262 downloads per month
Used in 7 crates
(5 directly)
7KB
104 lines
Current
A library for setting current values for stack scope, such as application structure
Current objects are put on a shadow stack for easy access by type. The type is used as an identifier to get the latest current object in scope.
This is used as a better alternative in Rust than mutable globals.
There are two objects in this library:
CurrentGuard
is used to create a current object using a mutable referenceCurrent
is used to access the reference by type