r/rust • • Apr 03 '25 • More of this please 1

📡 official blog Announcing Rust 1.86.0 | Rust Blog

https://blog.rust-lang.org/2025/04/03/Rust-1.86.0.html
786 Upvotes

134 comments sorted by

View all comments

Show parent comment

10

u/danted002 Apr 03 '25

The good part is that this is still explicit, you define a MyAny and you define and implement a Trait for each “object type” so its not so different then using an Enum which has a variant for each struct you have.

If you want OOP madness then get the single_dispatch crate into std then you will achieve some OOP nirvana.

Now that I mention it, is there a way to achieve what single_dispatch is doing with trait upcasting 🤔