Y
Hacker News
new
|
ask
|
show
|
jobs
by
lacampbell
3452 days ago
Right. I suppose in Rust you generally use variants and pattern matching when dynamic dispatching is required.
1 comments
steveklabnik
3452 days ago
You could, but that requires that you know all of the variants ahead of time. The advantage of trait objects is that you don't have to.
It really just depends on what exactly you're trying to do.
link
It really just depends on what exactly you're trying to do.