3 ms·
> you can store that T in any other generic struct that's parametrized by BarTrait, for example Not really. You can store it on any struct that specializes to
by marcosdumay 10mo ago
> you can store that T in any other generic struct that's parametrized by BarTrait, for example
Not really. You can store it on any struct that specializes to the same type of the value you received. If you get a pre-built struct from somewhere and try to store it there, your code won't compile.
- steveklabnik 10mo agoCan you show me what you’re talking about? I don’t understand what you mean. I’ll add a code example of what I mean in a bit.
- steveklabnik 10mo agoHere's what I'm talking about: https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=257b78a2c837c0217da5b8d1cd993f93 https://play.rust-lang.org/?version=stable&mode=debug&editio...