My problem is, that my Chart widget should be generic over it's entries as long as they implement Into<(f32, f32)>, but for the style callback I need the concrete type. I have no idea if this is even possible with Rust, and if so, how?
With the help from this post I was able to get to the point, where I'm generic over the collection of entries (see playground below), but I have really no idea, how I could get the style depending on the concrete type.
Why do you want a style method on Chart? It sounds like it should be on the series you are trying to store instead.
Edit:
I gave it a try, and the issue I stumbled upon is that in your current code you are storing a generic parameter in PointSeries, but the style method should be able to iterate through the data and map the items on it, so you would need to store an iterator instead.
Thank you for your help, yeah, I was probably a bit caught up with the generics and iterator trait bounds of my previous problem, so that I lost track of the goal itself. I think it would be possible if I would move the concrete series drawing part out of chart into the distinct series (in the real code, there are multiple types). This would be similar to a GUI API forwarding the concrete drawing into it's widgets.
Thanks for the link, too. I will give it a read and hopefully come back with a solution for the record.