Struct and Traits in Rust

Image for post
Image for post

Rust is not an OOP language. However, is possible to have similar behavior using Structs and traits. Traits are great because allow us to create common and interfaces and allow structure for generic coding. The struct is like a struct in C. They allow us to have Pojos and hold both data and behavior using traits. Today I want to show you guys how we can work with struct and traits in Rust. This is another short video focusing on understanding and also you will learn somethings about macros as well. So I hope you guys liked it, let’s get started !!!

Video

struct and traits in Rust from Diego Pacheco on Vimeo.

Code

Cheers,
Diego Pacheco

Originally published at http://diego-pacheco.blogspot.com on March 24, 2020.

Brazilian, Software Architect, SWE(Java, Scala, Rust, Go) SOA & DevOps expert, Author. Working with EKS/K8S. diegopacheco.github.io (Opinions on my own)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store