Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What is the representation for a type like Box<Reader+Writer>? Is there an extra indirection to get each of the vtables? Is there synthesized combined trait type and just one vtable pointer?


I am pretty sure you can't actually construct such a type (at least not at the moment) so Rust sort of sidesteps the question.


IIRC you can.


I get this when I try something like `as Box<Read+Write>`

    error: only the builtin traits can be used as closure or object bounds [E0225]


TIL; thanks :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: