Trait Objects
However, how can we store a collection of mixed types which implement ?
Memory layout after allocating xs
:
Similarly, you need a trait object if you want to return different types implementing a trait:
However, how can we store a collection of mixed types which implement ?
Memory layout after allocating xs
:
Similarly, you need a trait object if you want to return different types implementing a trait:
本文档使用 全库网 构建