DEV Community

Discussion on: Callbacks, Trait Objects & Associated Types, Oh My!

 
jeikabu profile image
jeikabu

Just realized I've yet looked at how to do that. Seems std::any::Any is the current solution.

But you're right, I suspect there's more Rust-y way to implement things.

Thread Thread
 
deciduously profile image
Ben Lovy • Edited

Yeah, I came across that too and played with it a little, but never found anything that didn't feel similarly kludgy. I don't really want to forfeit type checking, seems like a deeper structural change is likely in order.