I think what I want is specialization in Rust. But I'm not sure if that's actually what I want. E.g. I want to be able to define some method. But then if certain conditions apply define a different, more efficient method with the same signature. That's... specialization right?
Yeah, that's the idea! Which would allow us to do fun things like "if we read from a socket, and write to a socket, use a super efficient system call to handle it". But still keep the generic implementation for other types. This is all quite experimental still.
-
-
Also like
@mountain_ghosts pointed out: "choosing the most narrow definition" could get us oddly close to a CSS specificity kind of situation, which would probably not be ideal. Lots of stuff to figure out here still! -
in general there will not be a single most-narrow matching definition
- 4 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.