Closed ryan-summers closed 7 months ago
I opened https://github.com/rust-embedded-community/menu/issues/17 to investigate mechanisms of working around this limitation in menu
.
I don't see a way to pipe a borrowed value with an unknown lifetime into the Context
object currently if the Context
is owned by the menu
type.
There's a desire to update the
serial-settings
crate to borrow the settings structure mutably when processing I/O.There's some difficulties with figuring out how to manage this, as we need to then pipe the
Settings
borrowed item into themenu
Context
object.However, because the
Settings
structure will be borrowed for some run-time lifetime (i.e. unknown and not'static
), this presents difficulties with the current approach as theContext
structure cannot possible own the borrowedSettings
type due to the not-concreteSettings
borrow lifetime.I'll investigate some potential approaches to resolve this.