-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Taking ownership of menu in runner #15
Conversation
The Maybe we could change the runner to take |
Wait, no. I checked and my So this PR seems fine then. |
I think |
You can't derive(Clone) because rustc things that the <T> also needs to be cloneable, even though th Menu doesn't actually hold a T. So we just implement the trait manually.
Added a |
Sheesh, I haven't looked at this in ages. Have tidied up a bit. |
This PR refactors the
Runner
to take ownership of the root menu. This enables the menu to be created on an ad-hoc basis (i.e. not at the crate root) to be handed to theRunner
without lifetime worries.The impact is that we can't keep references to the menu internally, so we have to traverse the menu throughout operation. Open to some suggestions.
For an example as to why this is needed, refer to https://github.com/quartiq/stabilizer/pull/813/files#diff-f0b20facc8d3d2dfccda7199e70cb8af5ba9255d80e1d35fdd950dc6a2d567a3R30
I'm trying to build a generic "Serial Console Settings Manager" that uses
menu
for providing the UI for settings management