-
-
Notifications
You must be signed in to change notification settings - Fork 32
Support passing multiple input data references / lifetime GATs #488
Copy link
Copy link
Open
Description
Type Widget::Data is passed by reference and must have lifetime exceeding the widget (i.e. usually 'static). Implications:
- We cannot generate input data on-the-fly; it must be stored in the widget tree somewhere (e.g. it may be generated and cached by
fn Events::update). - We cannot pass multiple references as input data.
The generic solution to this would be to make type Widget::Data a GAT over a lifetime parameter, but Rust does not currently support usage of GATs in dyn-safe traits (see also #25) and we require that Widget be dyn-safe.
There may be other (partial) solutions, but any evaluated solutions are worse than forcing widgets to work around this limitation. (This might continue to be the case even if Rust does support dyn-safe lifetime GATs, but should be re-evaluated.)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels