Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Traits in Rust: Beyond Traditional Interfaces - Fundamentals and Advanced Features

Rust via YouTube

Overview

Explore the power of Rust traits in this comprehensive conference talk by Rainer Stropek. Delve into the fundamentals of traits, learning how to create and implement them, both manually and automatically. Discover unique features such as default implementations, trait parameters, trait objects, and trait bounds for generics. Through practical demonstrations, understand how traits differ from interfaces in other OO languages like TypeScript, C#, or Java. Gain insights into advanced concepts including enums, typecasting, unit tests, FromStr and Into traits, iterators, lifetimes, and more. Follow along as Rainer builds a Prince of Persia-inspired example, showcasing real-world applications of traits in Rust programming.

Syllabus

Introduction
Overview
Prince of Persia
Getting started with traits
What happens behind the scenes
Board content
enums
typecasting
unit tests
from and into
I32 trait
String trait
Board index
Board index type
Convert board index to usize
Parsing
FromString
RSTest
Two Compact String
Iterator structure
Lifetimes
Rows Iterator
Iterator
IndexMutable
Square Assessor
Is Valid
Behind the Scenes

Taught by

Rust

Reviews

Start your review of Traits in Rust: Beyond Traditional Interfaces - Fundamentals and Advanced Features

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.