Request for egui_plot::PlotItem to have + Send added

Hello please can the designers of Egui_plot add "+ Send" to PlotItem, as I (and no doubt many others) need to send PlotItem (x,y) points across threads, which currently cannot be done. I need it so as to be able to use a separate thread for drawing my oscilloscope trace. Without using threads, my Raspberry Pi Rust oscilloscope code is working albeit far too slowly! Many thanks

It looks like PlotItem is a trait. If you need a type-erased PlotItem that is Send, use dyn PlotItem + Send instead of just dyn PlotItem. If you're using other types that implement PlotItem, whether they are Send or not is a property of the type, not their implementation of PlotItem. It would be a breaking change for the PlotItem trait to require Send.

If you still have a request for a change to the library, the appropriate way to ask is to create an issue in the repo.

4 Likes

I've tried everything to make PlotItem "+ Send" and nothing works, so the library needs to be updated and I have now requested this via an issue in the repo as you stated, many thanks, I hope action is taken on this!

That is very unlikely. I suggest you look into other solutions to speed up your code.

The only other solution would be to use a different crate which DOES implement "+ Send" as it's essential to use threading to achieve the processing speed/ a fast oscilloscope trace.

You could also try an earlier version of egui_plot. They have recently changed the PlotPoints implementation which might have removed the Send trait.

ah thankyou! I'll give that a try. Looks like you're using egui_plot also! Many thanks, will reply later after I've torn the last of my hair out trying to fix this! :wink:

i've yet to find an earlier version of egui_plot where the Send trait is implemented. I've just tried the latest version (I was using the previous) and they seem to have changed things for the worse; the LINE draw doesn't work at all, so I'm at a dead end now. It's essential that I use threading for generating my oscilloscope trace as without it, it's painfully slow. The only other way is to go async. I'm also finding that a lot of the online AI generated Rust examples are full of errors and totally detrimental to my learning process!

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.