It is possible to make a call to a specific implementation of a generic method on a struct, ex:
impl Printer<i16> {
pub fn run() { println!("Specific i16"); }
}
Printer::<i16>::run();
It is also possible to make a blanket, default implementation of that method, ex:
trait Blanket<T: Printable> {
fn run() { println!("Blanket"); }
}
impl<T: Printable> Blanket<T> for Printer<T> {}
Why is it that attempting to call the specific implementation from a generic function does not work?
fn generic_run<T: Printable>() {
Printer::<T>::run();
}
generic_run::<i16>::(); // Prints "Blanket"
Is there a way to allow a generic function to dispatch to specific implementations?