Monthly Archives: March 2017

Polymorphism in Rust: Enum vs Trait + Struct

Rust isn’t an object-oriented language in the same way as C++ and Java. You cannot write classes that extend behavior from another class for example. However, Rust does support polymorphism and there are two common approaches. For this blog post I’m going to use an example of writing a crate for generating svg (scalable vector graphics) files based on a… Read more »