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

YouTube

Subtyping in Rust - Magic and Misconceptions

Rust via YouTube

Overview

Explore the concept of subtyping in Rust and its connection to Arthur C. Clarke's Third Law in this 54-minute conference talk by Felix Klock. Delve into the intricacies of Rust's subtyping system, learning where it exists and how it differs from expectations. Gain insights into variance, mutable references, unsafe cells, and automatic borrowing. Discover why subtyping in Rust can be considered "magical" and when it becomes crucial in complex data structure development. Engage with examples, deduction rules, and a pop quiz to reinforce your understanding of this advanced Rust topic.

Syllabus

Intro
Subtyping
Sanity Check
What is Subtyping
Integer to Integer Examples
Integer to Ceiling Examples
Java
Deduction Rules
Contravariance
Does Rust have variants
A magic trick
Rust Subtyping
mutable references
unsafe cell
duck subtyping
coercion
automatic borrowing
dereferences
pop quiz
variance

Taught by

Rust

Reviews

Start your review of Subtyping in Rust - Magic and Misconceptions

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.