You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently, all methods like Plot::{x,y}_grid_spacer or Plot::{x,y}_axis_formatter take an impl Fn... + 'static which is quite impractical mainly because these methods can easily require some access to self or other borrowed data.
Describe the solution you'd like
Introduce a lifetime for the Plot struct? Since a Plot is rarely stored in another struct, this shouldn't be too much of an issue.
Describe alternatives you've considered
Not using borrowed data or some sketchy shit with RefCells
…4435)
* Closes#4434
Shouldn't break anything, because when all arguments have a 'static
lifetime (required without this PR), the Plot is also 'static and can be
used like before.
emilk
pushed a commit
to emilk/egui_plot
that referenced
this issue
Jul 15, 2024
…#4435)
* Closesemilk/egui#4434
Shouldn't break anything, because when all arguments have a 'static
lifetime (required without this PR), the Plot is also 'static and can be
used like before.
…#4435)
* Closesemilk/egui#4434
Shouldn't break anything, because when all arguments have a 'static
lifetime (required without this PR), the Plot is also 'static and can be
used like before.
Is your feature request related to a problem? Please describe.
Currently, all methods like
Plot::{x,y}_grid_spacer
orPlot::{x,y}_axis_formatter
take animpl Fn... + 'static
which is quite impractical mainly because these methods can easily require some access toself
or other borrowed data.Describe the solution you'd like
Introduce a lifetime for the
Plot
struct? Since a Plot is rarely stored in another struct, this shouldn't be too much of an issue.Describe alternatives you've considered
Not using borrowed data or some sketchy shit with RefCells
Additional context
Basic example:
This does currently not work because
x_axis_formatter
requires a'static
lifetimeThe text was updated successfully, but these errors were encountered: