Master resource vs. thread local storage

There's been a similar discussion recently and people seem to favor passing the Display around. Static thread safety enforcement is a nice feature. It should still be possible to add simpler APIs relying on TLS (panicing on errors) if there is demand.

I see another problem with this example: the use of &mut references. I don't think you can get very far if every action requires a unique reference to the display. How would you create a window from an event handler closure?

1 Like