Hello,
I am quite new to Rust. I don't understand the code below. The problem is the definition of the trait Add. I don't know the meannig of the suffix<T=Self>. I know the meaning of Self: This is the type of the current object. For example Self is Pointin fn add(&self, other:&(i32,i32))->Self in impl Add<(i32,i32)> for Point.
But I don't understand why this suffix is necessary for the compilation.
It means you can refer to Add without any type parameters and it will assume T is Self, or you can specify it manually like Add<u64> and then the default value is ignored.
Since a lot of arithmetic operations end up being mostly used in contexts where both operands are the same type, it can be convenient to not have to specify T.