Creating data structures in rust

While we are familiar with how primitive types can be used to write programs that just work, at times it is much easier to manage related data in an encapsulated manner. Influenced by the concepts of Object Oriented Programming, rust enables you to write better code with structs and enums that also allow you to embed behaviour in the form of methods implemented on these structs.