Introduction to Generics and Traits | Advanced Rust Part 1

Опубликовано: 23 Март 2026
на канале: Green Tea Coding
12,479
423

Watch the rest of this series:    • Advanced Rust  
New to Rust? Check out my fundamentals series:
   • How to become a Rust Developer  

Rust doesn't have inheritance, instead traits are the way to go if you want polymorphism. In this video, I cover traits and the closely related generics. Polymorphism will come in a future video.

Find me elsewhere:
🐘 Mastodon: https://mastodon.social/@GreenTeaCoding

00:00 Intro
01:05 Example: why we need Generics
03:55 Use of Generics
04:15 Type restriction with Traits
06:35 AddAssign Trait
07:47 Copy Trait
09:03 Copy (Documentation)
12:48 Calling Generics
15:24 Outro


#rustlang #coding #tutorial