Closed Zedjones closed 6 years ago
You need to enable the const_fn
feature on state
to get const
constructors. This is documented in the README
and in the crate's documentation: https://sergio.bz/rustdocs/state/#usage
Thank you! I must have completely missed that. Sorry about that.
error[E0015]: calls in statics are limited to constant functions, tuple structs and tuple variants --> src/main.rs:38:38 | 38 | static GLOBAL: state::Storage<u32> = state::Storage::new();
I realize that this is likely due to a change in what are allowed to be global statics, but is there any workaround for this?
I'm trying to write a server in Rust which needs to run threads at all times but they also need to referenced back to so I need some way to keep track of them. If this isn't a solution, what would you recommend?Nevermind, I found the State page of the Rocket guide which should work, but the README should still probably be updated.