Re:Abstraction without overhead: traits in Rust
by kalmar on Monday May 11, 2015 @11:29PM
(#9529437)
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?
[ Parent
| on HN ]
Re:Abstraction without overhead: traits in Rust
by Jweb_Guru on Tuesday May 12, 2015 @01:23AM
(#9529734)
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.
Re:Abstraction without overhead: traits in Rust
by Manishearth on Tuesday May 12, 2015 @06:03AM
(#9530570)
IIRC you can.
Re:Abstraction without overhead: traits in Rust
by Rusky on Tuesday May 12, 2015 @09:07AM
(#9531409)
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]
Re:Abstraction without overhead: traits in Rust
by Manishearth on Tuesday May 12, 2015 @09:32AM
(#9531582)
TIL; thanks :)