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?
-
-
if the trait bounds on the generic Socket<T> are for traits none of the concrete types implement, that's fine
-
or possibly if you have a trait bound that a concrete type partially matches, e.g. impl<T: AsyncRead + Copy> Socket<T> impl Socket<File> File might be AsyncRead but it's not Copy so the generic form doesn't apply, maybe?
- 10 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.