Introduction to Structs, Traits, and Zero-Cost Abstractions in Rust
Offered By: Rust via YouTube
Course Description
Overview
Explore an introduction to structs, traits, and zero-cost abstractions in Rust through this 22-minute conference talk recorded at the Rust KW Meetup in Kitchener-Waterloo, Canada. Gain insights into building efficient abstractions and writing better code without compromising performance. Learn about structs, traits, generics, and their applications in Rust programming. Discover the concept of zero-cost abstractions and their benefits. Examine practical examples, including append-only vectors and logger implementations. Compare dynamic dispatch with trait objects to generics, and understand their impact on optimization. Ideal for programmers experienced in other languages but new to Rust.
Syllabus
Intro
Why Rust? (for me)
Introducing: structs
Add some methods
Using Point2D
Let's add a parameter
Thinking like a compiler
Zero cost abstraction!
What can we do with zero cost abstractions?
Append-only vectors
The recipe
A motivating example
How about a "Logger" type?
Different types of Loggers
Better idea: a Logger trait
PrintLogger implements Logger
Pass me a Logger, any Logger
Dynamic dispatch with trait objects
Trait objects prevent some optimizations
Generics!
Add logging to a fibonacci calculation
Generics vs trait objects
Taught by
Rust
Related Courses
C++ For C Programmers, Part AUniversity of California, Santa Cruz via Coursera Programming Languages, Part C
University of Washington via Coursera AP Computer Science A: Java Programming Polymorphism and Advanced Data Structures
Purdue University via edX Введение в iOS-разработку
Moscow Institute of Physics and Technology via Coursera Java Programming: Step by Step from A to Z
Udemy