Add trait in Rust

Rust has this interesting trait called Add which allows us to use the + operator and add 2 structs together. This is very useful for numeric types but also for engineering productivity lets say you are building a DSL for instance or an internal DSL. So I made some implementation and a video — Let’s get started!

The Video

The Code

Cheers,

Diego Pacheco

Originally published at http://diego-pacheco.blogspot.com on July 5, 2021.