Downcast a non-‘static type
⚓ Rust 📅 2025-05-09 👤 surdeus 👁️ 11Is there any way to downcast from dyn Trait to the original type for types that don’t implement Any? I know for sure that my value is of the correct type so I don’t really need to check the type ID, and as far as I can tell the rest is just a simple transmute. But I’m assuming that the transmute is an implementation detail that I shouldn’t rely on, is there any official way of doing this?
Edit: a short example of what I mean.
9 posts - 4 participants
🏷️ rust_feed