Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
kalmar
on May 12, 2015
|
parent
|
context
|
favorite
| on:
Abstraction without overhead: traits in Rust
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?
Jweb_Guru
on May 12, 2015
[–]
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.
Manishearth
on May 12, 2015
|
parent
[–]
IIRC you can.
Rusky
on May 12, 2015
|
root
|
parent
[–]
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]
Manishearth
on May 12, 2015
|
root
|
parent
[–]
TIL; thanks :)
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: