quartiq / stabilizer

Firmware and software for the Sinara Stabilizer module with high speed, low latency ADC/DAC data processing and powerful DSP algorithms in between
http://quartiq.de/stabilizer/
Apache License 2.0
111 stars 27 forks source link

Add borrowed-settings to `serial-settings` #871

Closed ryan-summers closed 7 months ago

ryan-summers commented 7 months ago

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 the menu 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 the Context structure cannot possible own the borrowed Settings type due to the not-concrete Settings borrow lifetime.

I'll investigate some potential approaches to resolve this.

ryan-summers commented 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.