trait MulawExt: Iterator {
fn mulaw(self) -> Mulaw<Self> where Self: Sized;
}
impl<I> MulawExt for I where I: Iterator<Item = u16> {
fn mulaw(self) -> Mulaw<Self> where Self: Sized {
unimplemented!()
}
}
But then adding this implementation for when Item = u8 errors out.
impl<I> MulawExt for I where I: Iterator<Item = u8> {
fn mulaw(self) -> Mulaw<Self> where Self: Sized {
unimplemented!()
}
}
conflicting implementations of trait MulawExt:
Is it possible to overload different implementations of a trait function for specific concrete or primitive types and constrained to an associated type? A trait function foo() for <Item = SomeType> and a trait function foo() for <Item = f64> etc