Re:Dioxus 0.5: Web, Desktop, Mobile Apps in Rust
by skybrian on Thursday March 28, 2024 @01:01PM
(#39854352)
Thanks. I’m wondering if this allows for non-static data at all? Maybe it has to be either static or copyable?
Re:Dioxus 0.5: Web, Desktop, Mobile Apps in Rust
by Evan-Almloff on Thursday March 28, 2024 @01:07PM
(#39854461)
All data you insert into a generational box needs to be allowed to last for the 'static lifetime (have no internal temporary pointers). You cannot insert something like &'a str into a generational box
It uses a very similar approach to a generational arena but with boxes instead of a centralized arena (to avoid locking issues). If you try to access the Copy reference to the data after it has been dropped, it will fail with a nice error message