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: