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?
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
-
e.g. picture I have these: impl<T: Copy> Something for Vec<T> impl<T: Ord> Something for Vec<T> which do I pick for Vec<u8>
- 3 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.