Crates.io | current |
lib.rs | current |
version | 1.0.1 |
created_at | 2015-01-13 21:21:13.299134+00 |
updated_at | 2025-03-22 17:02:01.777965+00 |
description | A library for setting current values for stack scope, such as application structure |
homepage | https://github.com/pistondevelopers/current |
repository | https://github.com/pistondevelopers/current.git |
max_upload_size | |
id | 780 |
size | 8,998 |
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