Rust: use specific trait out of many possible ones

前端 未结 0 838
情歌与酒
情歌与酒 2020-12-13 08:24

I have some structs that can implement traits, and an enum representing which trait to use.

If I store the struct in a variable, match on the enum, and then run the t

相关标签:
回答
  • 消灭零回复
提交回复
热议问题