Mut self in Fairings #2929
Unanswered
ThomasMonkman
asked this question in
Questions
Replies: 1 comment
-
I don't think your |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, First off, my rust, is well rusty, so I apologise if I'm using rust the wrong way to achieve what I want.
I am using rocket as a game server, I want a separate thread running the main game loop, to ensure it shuts down correctly I'm using
AdHoc::on_liftoff
andAdHoc::on_shutdown
to spawn both an thread, and then signal and wait for its shut down. This works, and I'll attach the code.Adhoc version
I saw that the same can be achieved with fairings, this to me seems far neater, as I can have it all self contained. However the callbacks in the fairings don't get access to
&mut self
?Attempt at fairings version
Thank you very much, again my rust is not very good, so I appreciate I might be doing things the wrong way etc... but any help would be appreciated!
Beta Was this translation helpful? Give feedback.
All reactions