rust - What ways exist to create containers of several types? -


this question has answer here:

i know ways have container containing several types. know that:

  • a tuple can contain several types
  • if create enumeration e, can create vec<e>.

in c++, can create vec<a*> containing both b* , c* elements if b , c inherit a. can similar in rust? instance, if several types implement same trait?

1) can store references or pointers trait objects.

2) can create enum on things want store.


Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -