Crates.io | unsafe-storage |
lib.rs | unsafe-storage |
version | 0.1.1 |
source | src |
created_at | 2021-12-20 20:40:12.035151 |
updated_at | 2021-12-20 20:42:54.451864 |
description | Maintain invariants in macros without modules |
homepage | |
repository | https://github.com/andrewgazelka/unsafe-storage |
max_upload_size | |
id | 500852 |
size | 3,249 |
UnsafeStorage
is used to mark that there are some arbitrary invariants
which must be maintained in storing its inner value. Therefore, creation and
modifying of the inner value is an "unsafe" behavior. Although it might not
be unsafe in traditional Rust terms (no memory unsafety), behavior might be
"undefined"—or at least undocumented, because invariants are expected to be
upheld.
This is useful in macros which do not encapsulate their storage in modules. This makes the macros for the end-user more ergonomic, as they can use the macro multiple times in a single module.