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?
This might work for concrete types already (haven't checked, believe there's some cases in which it works). But I believe you can't specify more specific trait bounds for T that's not a concrete type.
-
-
My theoretical knowledge around this stuff is still... not great -- I feel like I know what I want, but not confident in which constraints currently exist.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
yes, you can have multiple concrete impls, e.g. Socket<File>, Socket<SomeOtherThing>, etc, but your generic Socket<T> might conflict with them
-
Ahh, yes okay -- gotcha!
- 12 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.