Skip to content

How can I get a mutable state within a fairing? #2398

Discussion options

You must be logged in to vote

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.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by asnaseer-resilient
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants