Is overloading `=` possible in Rust?

I'm looking at std::ops - Rust

I see AddAssign, MulAssign, ... but no Assign.

Is it possible to overload = in Rust ?

no, it is not possible to overload the assignment operator

5 Likes

Some good reasoning for why it's not possible is detailed in this thread: Why not an Assign trait?

6 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.