Closed derMihai closed 1 month ago
Can https://github.com/embassy-rs/static-cell be re-used?
Can https://github.com/embassy-rs/static-cell be re-used?
definitely. Hours of looking for exactly that made me write this in the first place. We can close.
Contribution
It might be the case that I am re-inventing the wheel, but to this moment, I could find no obvious way of defining mutable data with static storage. This is often required for large data structures that are not possible to allocate on stack (e.g. buffers).
This PR adds a
static_data
module, a safe wrapper that allows obtaining exactly one mutable reference to static data.Testing
I tested this on native in a small application, but I could not find a way to successfully run
cargo test
.