Главная
Study mode:
on
1
Intro
2
Why Rust? (for me)
3
Introducing: structs
4
Add some methods
5
Using Point2D
6
Let's add a parameter
7
Thinking like a compiler
8
Zero cost abstraction!
9
What can we do with zero cost abstractions?
10
Append-only vectors
11
The recipe
12
A motivating example
13
How about a "Logger" type?
14
Different types of Loggers
15
Better idea: a Logger trait
16
PrintLogger implements Logger
17
Pass me a Logger, any Logger
18
Dynamic dispatch with trait objects
19
Trait objects prevent some optimizations
20
Generics!
21
Add logging to a fibonacci calculation
22
Generics vs trait objects
Description:
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.

Introduction to Structs, Traits, and Zero-Cost Abstractions in Rust

Rust
Add to list