How can I get a mutable state within a fairing? #2398
-
I am using Rocket v0.5.0-rc.1 and have added a managed state to rocket using
The Is there anyway of getting this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Since Fairings can run in parallel, you Rocket can't give you mutable access to the managed state. As such, you would need to use some kind of interior mutability, such as a Mutex or RwLock. |
Beta Was this translation helpful? Give feedback.
Since Fairings can run in parallel, you Rocket can't give you mutable access to the managed state. As such, you would need to use some kind of interior mutability, such as a Mutex or RwLock.