I have a trait that implements another trait:
trait RandomAccessIterator : Sub + VariousOthers {}
How do I specify, that for all implementations of this trait, the result of the subtraction (the Output
type within Sub
) must be of a certain type, such as isize
? That way, if I write a generic function which uses objects implementing this trait, I know (and more importantly, the compiler knows) that the result of A - B
is type isize
.